From 6f0d0afdb8d0dadb53c156a4faab6865bd278e8e Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 02:34:46 +0000 Subject: [PATCH] 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. --- spec/views/crops/show.html.haml_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/views/crops/show.html.haml_spec.rb b/spec/views/crops/show.html.haml_spec.rb index f65f0621e..5d1e77339 100644 --- a/spec/views/crops/show.html.haml_spec.rb +++ b/spec/views/crops/show.html.haml_spec.rb @@ -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