From 43def0517abd71ee524e166e81594af23ad80461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 8 Jan 2021 14:11:42 +0100 Subject: [PATCH 1/3] Fix SDG manager spec filename We forgot the `_spec` suffix. --- spec/models/abilities/sdg/{manager.rb => manager_spec.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spec/models/abilities/sdg/{manager.rb => manager_spec.rb} (100%) diff --git a/spec/models/abilities/sdg/manager.rb b/spec/models/abilities/sdg/manager_spec.rb similarity index 100% rename from spec/models/abilities/sdg/manager.rb rename to spec/models/abilities/sdg/manager_spec.rb From afda9ab3b733f1afe9c00751ac9b8a7e352b6ea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 8 Jan 2021 14:25:30 +0100 Subject: [PATCH 2/3] Fix string literal with single quote It was accidentally introduced in commit de4be15a8. --- spec/controllers/sdg/goals_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/sdg/goals_spec.rb b/spec/controllers/sdg/goals_spec.rb index f72c283dd..054ed28b8 100644 --- a/spec/controllers/sdg/goals_spec.rb +++ b/spec/controllers/sdg/goals_spec.rb @@ -1,4 +1,4 @@ -require 'rails_helper' +require "rails_helper" describe SDG::GoalsController do context "featured disabled" do From c5a6ee74c48bcc25748caaadc70bd6b29b5f0aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 9 Jan 2021 15:47:37 +0100 Subject: [PATCH 3/3] Fix component specs using "within" These specs were passing because the `within` method does not work in components specs. We have to use `page.find` instead. --- .../admin/poll/officers/officers_component_spec.rb | 10 ++++++---- .../sdg_management/subnavigation_component_spec.rb | 6 ++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/components/admin/poll/officers/officers_component_spec.rb b/spec/components/admin/poll/officers/officers_component_spec.rb index 5d8e9a79a..f80fbb026 100644 --- a/spec/components/admin/poll/officers/officers_component_spec.rb +++ b/spec/components/admin/poll/officers/officers_component_spec.rb @@ -7,10 +7,12 @@ describe Admin::Poll::Officers::OfficersComponent, type: :component do let(:component) { Admin::Poll::Officers::OfficersComponent.new(officers) } it "renders as many rows as officers" do - within "tbody" do - expect(page).to have_css "tr", count: 2 - expect(page).to have_css "a", count: 2 - end + render_inline component + + tbody = page.find("tbody") + + expect(tbody).to have_css "tr", count: 2 + expect(tbody).to have_css "a", count: 2 end it "renders link to destroy for existing officers" do diff --git a/spec/components/sdg_management/subnavigation_component_spec.rb b/spec/components/sdg_management/subnavigation_component_spec.rb index 11975e549..40f5d9ae0 100644 --- a/spec/components/sdg_management/subnavigation_component_spec.rb +++ b/spec/components/sdg_management/subnavigation_component_spec.rb @@ -21,10 +21,8 @@ describe SDGManagement::SubnavigationComponent, type: :component do end it "renders given block within active panel" do - render_inline component + render_inline(component) { "Tab content" } - within "#goals.tabs-panel.is-active" do - expect(page).to have_content("Tab content") - end + expect(page.find(".tabs-panel.is-active")).to have_content("Tab content") end end