Files
nairobi/spec/system/admin/debates_spec.rb
Javi Martín 9427f01442 Use system specs instead of feature specs
We get rid of database cleaner, and JavaScript tests are faster because
between tests we now rollback transactions instead of truncating the
database.
2020-04-24 15:43:54 +02:00

26 lines
533 B
Ruby

require "rails_helper"
describe "Admin debates" do
before do
admin = create(:administrator)
login_as(admin.user)
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
debate = create(:debate)
visit admin_debate_path(debate)
expect(page).to have_content(debate.title)
expect(page).to have_content(debate.description)
end
end