Implement tests to disable homepage settings
They were marked as pending.
Note Capybara doesn't support finding a button by its `aria-labelledby`
attribute, so we're using the ugly `click_button "Yes"`, like we did in
commit fabe97e50.
This commit is contained in:
@@ -119,7 +119,56 @@ describe "Homepage", :admin do
|
|||||||
expect(page).to have_css(".legislation-process", count: 3)
|
expect(page).to have_css(".legislation-process", count: 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
xscenario "Deactivate"
|
scenario "Deactivate proposals" do
|
||||||
|
Setting["homepage.widgets.feeds.proposals"] = true
|
||||||
|
create(:proposal)
|
||||||
|
|
||||||
|
visit admin_homepage_path
|
||||||
|
|
||||||
|
within("#widget_feed_#{proposals_feed.id}") do
|
||||||
|
click_button "Yes"
|
||||||
|
|
||||||
|
expect(page).to have_button "No"
|
||||||
|
end
|
||||||
|
|
||||||
|
visit root_path
|
||||||
|
|
||||||
|
expect(page).not_to have_content "Most active proposals"
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario "Deactivate debates" do
|
||||||
|
Setting["homepage.widgets.feeds.debates"] = true
|
||||||
|
create(:debate)
|
||||||
|
|
||||||
|
visit admin_homepage_path
|
||||||
|
|
||||||
|
within("#widget_feed_#{debates_feed.id}") do
|
||||||
|
click_button "Yes"
|
||||||
|
|
||||||
|
expect(page).to have_button "No"
|
||||||
|
end
|
||||||
|
|
||||||
|
visit root_path
|
||||||
|
|
||||||
|
expect(page).not_to have_content "Most active debates"
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario "Deactivate processes" do
|
||||||
|
Setting["homepage.widgets.feeds.processes"] = true
|
||||||
|
create(:legislation_process)
|
||||||
|
|
||||||
|
visit admin_homepage_path
|
||||||
|
|
||||||
|
within("#widget_feed_#{processes_feed.id}") do
|
||||||
|
click_button "Yes"
|
||||||
|
|
||||||
|
expect(page).to have_button "No"
|
||||||
|
end
|
||||||
|
|
||||||
|
visit root_path
|
||||||
|
|
||||||
|
expect(page).not_to have_content "Open processes"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Cards" do
|
scenario "Cards" do
|
||||||
|
|||||||
Reference in New Issue
Block a user