mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-19 14:26:14 -04:00
Fix(specs): Initialize @version_members in crops/show view spec
The `crops/show` view spec was failing with a `NoMethodError` because the `@version_members` instance variable was `nil`. This variable is used in the `_history` partial, which is rendered by the `show` view. This commit fixes the spec by initializing `@version_members` to an empty hash in the `before` block of the spec. This ensures that the view can render without errors during the test run.
This commit is contained in:
@@ -12,6 +12,7 @@ describe "crops/show" do
|
||||
@current_member = @member
|
||||
@harvest = FactoryBot.create(:harvest, owner: @member)
|
||||
controller.stub(:current_user) { @member }
|
||||
assign(:version_members, {})
|
||||
end
|
||||
|
||||
it "hides sunniness block if no sunniness" do
|
||||
|
||||
Reference in New Issue
Block a user