diff --git a/spec/components/admin/budgets/duration_component_spec.rb b/spec/components/admin/budgets/duration_component_spec.rb index a95c44108..d84d13c7b 100644 --- a/spec/components/admin/budgets/duration_component_spec.rb +++ b/spec/components/admin/budgets/duration_component_spec.rb @@ -49,7 +49,7 @@ describe Admin::Budgets::DurationComponent do render Admin::Budgets::DurationComponent.new(durable).duration - expect(page.text).to be_empty + expect(page).not_to be_rendered end it "is not defined when no start date is defined" do @@ -57,7 +57,7 @@ describe Admin::Budgets::DurationComponent do render Admin::Budgets::DurationComponent.new(durable).duration - expect(page.text).to be_empty + expect(page).not_to be_rendered end end diff --git a/spec/components/admin/budgets_wizard/headings/group_switcher_component_spec.rb b/spec/components/admin/budgets_wizard/headings/group_switcher_component_spec.rb index a0e0ee1cb..56e7e825d 100644 --- a/spec/components/admin/budgets_wizard/headings/group_switcher_component_spec.rb +++ b/spec/components/admin/budgets_wizard/headings/group_switcher_component_spec.rb @@ -6,8 +6,7 @@ describe Admin::BudgetsWizard::Headings::GroupSwitcherComponent do render_inline Admin::BudgetsWizard::Headings::GroupSwitcherComponent.new(group) - expect(page.text).to be_empty - expect(page).not_to have_css ".budget-group-switcher" + expect(page).not_to be_rendered end it "renders a link to switch group for budgets with two groups" do diff --git a/spec/components/budgets/investments/filters_component_spec.rb b/spec/components/budgets/investments/filters_component_spec.rb index 5fe213934..88e9c075d 100644 --- a/spec/components/budgets/investments/filters_component_spec.rb +++ b/spec/components/budgets/investments/filters_component_spec.rb @@ -16,7 +16,7 @@ describe Budgets::Investments::FiltersComponent do render_inline Budgets::Investments::FiltersComponent.new - expect(page.native.inner_html).to be_empty + expect(page).not_to be_rendered end end diff --git a/spec/components/budgets/supports_info_component_spec.rb b/spec/components/budgets/supports_info_component_spec.rb index 64b563877..1bf10f986 100644 --- a/spec/components/budgets/supports_info_component_spec.rb +++ b/spec/components/budgets/supports_info_component_spec.rb @@ -28,8 +28,7 @@ describe Budgets::SupportsInfoComponent do render_inline component - expect(page).not_to have_selector ".supports-info" - expect(page.text).to be_empty + expect(page).not_to be_rendered end describe "#total_supports" do diff --git a/spec/components/layout/locale_switcher_component_spec.rb b/spec/components/layout/locale_switcher_component_spec.rb index d703aa62f..0edb9e968 100644 --- a/spec/components/layout/locale_switcher_component_spec.rb +++ b/spec/components/layout/locale_switcher_component_spec.rb @@ -13,8 +13,7 @@ describe Layout::LocaleSwitcherComponent do it "doesn't render anything" do render_inline component - expect(page.text).to be_empty - expect(page).not_to have_css ".locale" + expect(page).not_to be_rendered end end diff --git a/spec/components/layout/social_component_spec.rb b/spec/components/layout/social_component_spec.rb index 757051538..e3956e215 100644 --- a/spec/components/layout/social_component_spec.rb +++ b/spec/components/layout/social_component_spec.rb @@ -33,7 +33,7 @@ describe Layout::SocialComponent do render_inline Layout::SocialComponent.new - expect(page).not_to have_css "ul" + expect(page).not_to be_rendered end end end diff --git a/spec/components/layout/top_links_component_spec.rb b/spec/components/layout/top_links_component_spec.rb index e9e297d26..1f69a02b1 100644 --- a/spec/components/layout/top_links_component_spec.rb +++ b/spec/components/layout/top_links_component_spec.rb @@ -13,7 +13,7 @@ describe Layout::TopLinksComponent do it "does not render when no content block is defined" do render_inline Layout::TopLinksComponent.new - expect(page).not_to have_css "ul" + expect(page).not_to be_rendered end end end diff --git a/spec/components/machine_learning/comments_summary_component_spec.rb b/spec/components/machine_learning/comments_summary_component_spec.rb index 7cc32b12b..71c861d23 100644 --- a/spec/components/machine_learning/comments_summary_component_spec.rb +++ b/spec/components/machine_learning/comments_summary_component_spec.rb @@ -22,7 +22,7 @@ describe MachineLearning::CommentsSummaryComponent do render_inline component - expect(page.native.inner_html).to be_empty + expect(page).not_to be_rendered end it "is not displayed when the machine learning feature is disabled" do @@ -30,7 +30,7 @@ describe MachineLearning::CommentsSummaryComponent do render_inline component - expect(page.native.inner_html).to be_empty + expect(page).not_to be_rendered end it "is not displayed when there's no summary" do @@ -38,6 +38,6 @@ describe MachineLearning::CommentsSummaryComponent do render_inline MachineLearning::CommentsSummaryComponent.new(commentable) - expect(page.native.inner_html).to be_empty + expect(page).not_to be_rendered end end diff --git a/spec/components/sdg/goals/help_page_component_spec.rb b/spec/components/sdg/goals/help_page_component_spec.rb index 250dd4e91..35b4a1395 100644 --- a/spec/components/sdg/goals/help_page_component_spec.rb +++ b/spec/components/sdg/goals/help_page_component_spec.rb @@ -13,7 +13,7 @@ describe SDG::Goals::HelpPageComponent do render_inline component - expect(page).not_to have_css ".sdg-help-content" + expect(page).not_to be_rendered end it "renders content when the feature is enabled" do diff --git a/spec/components/sdg/goals/plain_tag_list_component_spec.rb b/spec/components/sdg/goals/plain_tag_list_component_spec.rb index cd629f26b..930192930 100644 --- a/spec/components/sdg/goals/plain_tag_list_component_spec.rb +++ b/spec/components/sdg/goals/plain_tag_list_component_spec.rb @@ -14,7 +14,7 @@ describe SDG::Goals::PlainTagListComponent do render_inline component - expect(page).not_to have_css "li" + expect(page).not_to be_rendered end it "does not render when the SDG process feature is disabled" do diff --git a/spec/components/sdg/goals/tag_list_component_spec.rb b/spec/components/sdg/goals/tag_list_component_spec.rb index b47bcd5b9..65aec351e 100644 --- a/spec/components/sdg/goals/tag_list_component_spec.rb +++ b/spec/components/sdg/goals/tag_list_component_spec.rb @@ -14,7 +14,7 @@ describe SDG::Goals::TagListComponent do render_inline component - expect(page).not_to have_css "li" + expect(page).not_to be_rendered end it "does not render when the SDG process feature is disabled" do @@ -22,7 +22,7 @@ describe SDG::Goals::TagListComponent do render_inline component - expect(page).not_to have_css "li" + expect(page).not_to be_rendered end it "renders a list of goals" do diff --git a/spec/components/sdg/goals/targets_component_spec.rb b/spec/components/sdg/goals/targets_component_spec.rb index 072abf99f..36b435fc9 100644 --- a/spec/components/sdg/goals/targets_component_spec.rb +++ b/spec/components/sdg/goals/targets_component_spec.rb @@ -13,9 +13,7 @@ describe SDG::Goals::TargetsComponent do render_inline component - expect(page).not_to have_css ".targets" - expect(page).not_to have_css "#target_tabs" - expect(page).not_to have_css ".tabs-content" + expect(page).not_to be_rendered end it "renders tabs panel" do diff --git a/spec/components/sdg/related_list_selector_component_spec.rb b/spec/components/sdg/related_list_selector_component_spec.rb index 9d8509245..f06280fa0 100644 --- a/spec/components/sdg/related_list_selector_component_spec.rb +++ b/spec/components/sdg/related_list_selector_component_spec.rb @@ -15,7 +15,7 @@ describe SDG::RelatedListSelectorComponent do render_inline component - expect(page).not_to have_css ".sdg-related-list-selector" + expect(page).not_to be_rendered end it "does not render when the SDG process feature is disabled" do @@ -23,7 +23,7 @@ describe SDG::RelatedListSelectorComponent do render_inline component - expect(page).not_to have_css ".sdg-related-list-selector" + expect(page).not_to be_rendered end it "renders related_sdg_list field" do diff --git a/spec/components/sdg/tag_list_component_spec.rb b/spec/components/sdg/tag_list_component_spec.rb index c262250c1..d61f3029d 100644 --- a/spec/components/sdg/tag_list_component_spec.rb +++ b/spec/components/sdg/tag_list_component_spec.rb @@ -27,7 +27,7 @@ describe SDG::TagListComponent do render_inline SDG::TagListComponent.new(record) - expect(page.native.inner_html).to be_empty + expect(page).not_to be_rendered end context "when linkable is false" do diff --git a/spec/components/sdg/targets/plain_tag_list_component_spec.rb b/spec/components/sdg/targets/plain_tag_list_component_spec.rb index 801273bde..9606153b9 100644 --- a/spec/components/sdg/targets/plain_tag_list_component_spec.rb +++ b/spec/components/sdg/targets/plain_tag_list_component_spec.rb @@ -18,7 +18,7 @@ describe SDG::Targets::PlainTagListComponent do render_inline component - expect(page).not_to have_css "li" + expect(page).not_to be_rendered end it "does not render when the SDG process feature is disabled" do @@ -26,7 +26,7 @@ describe SDG::Targets::PlainTagListComponent do render_inline component - expect(page).not_to have_css "li" + expect(page).not_to be_rendered end it "renders a list of targets" do diff --git a/spec/components/sdg/targets/tag_list_component_spec.rb b/spec/components/sdg/targets/tag_list_component_spec.rb index 327c7aa56..db8a7bcff 100644 --- a/spec/components/sdg/targets/tag_list_component_spec.rb +++ b/spec/components/sdg/targets/tag_list_component_spec.rb @@ -18,7 +18,7 @@ describe SDG::Targets::TagListComponent do render_inline component - expect(page).not_to have_css "li" + expect(page).not_to be_rendered end it "does not render when the SDG process feature is disabled" do @@ -26,7 +26,7 @@ describe SDG::Targets::TagListComponent do render_inline component - expect(page).not_to have_css "li" + expect(page).not_to be_rendered end it "renders a list of targets" do diff --git a/spec/components/shared/banner_component_spec.rb b/spec/components/shared/banner_component_spec.rb index 9dc1113a2..5723dd54c 100644 --- a/spec/components/shared/banner_component_spec.rb +++ b/spec/components/shared/banner_component_spec.rb @@ -82,13 +82,13 @@ describe Shared::BannerComponent do render_inline Shared::BannerComponent.new("debates") - expect(page).not_to have_css ".banner" + expect(page).not_to be_rendered end end it "does not render anything given nil" do render_inline Shared::BannerComponent.new(nil) - expect(page).not_to have_css ".banner" + expect(page).not_to be_rendered end end diff --git a/spec/components/shared/link_list_component_spec.rb b/spec/components/shared/link_list_component_spec.rb index 8dea5fb90..93e57cb01 100644 --- a/spec/components/shared/link_list_component_spec.rb +++ b/spec/components/shared/link_list_component_spec.rb @@ -4,22 +4,21 @@ describe Shared::LinkListComponent do it "renders nothing with an empty list" do render_inline Shared::LinkListComponent.new - expect(page).not_to have_css "ul" + expect(page).not_to be_rendered end it "returns nothing with a list of nil elements" do render_inline Shared::LinkListComponent.new(nil, nil) - expect(page).not_to have_css "ul" + expect(page).not_to be_rendered end it "generates a list of links" do render_inline Shared::LinkListComponent.new( ["Home", "/"], ["Info", "/info"], class: "menu" ) - list = page.find("body").native.inner_html - expect(list).to eq '