Add tests for debates and comments admin index

This commit is contained in:
Javi Martín
2019-11-10 03:31:05 +01:00
parent 940f099505
commit a84cf54c73
2 changed files with 18 additions and 0 deletions

View File

@@ -5,4 +5,13 @@ describe "Admin comments" do
admin = create(:administrator) admin = create(:administrator)
login_as(admin.user) login_as(admin.user)
end end
scenario "Index" do
create(:comment, body: "Everything is awesome")
visit admin_root_path
within("#side_menu") { click_link "Comments" }
expect(page).to have_content "Everything is awesome"
end
end end

View File

@@ -6,6 +6,15 @@ describe "Admin debates" do
login_as(admin.user) login_as(admin.user)
end end
scenario "Index" do
create(:debate, title: "Best beaches")
visit admin_root_path
within("#side_menu") { click_link "Debates" }
expect(page).to have_content "Best beaches"
end
scenario "Show debate" do scenario "Show debate" do
debate = create(:debate) debate = create(:debate)
visit admin_debate_path(debate) visit admin_debate_path(debate)