Files
nairobi/spec/system/budget_polls/polls_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

29 lines
699 B
Ruby

require "rails_helper"
describe "Polls" do
context "Public index" do
scenario "Budget polls should not be listed" do
poll = create(:poll)
budget_poll = create(:poll, :for_budget)
visit polls_path
expect(page).to have_content(poll.name)
expect(page).not_to have_content(budget_poll.name)
end
end
context "Admin index" do
scenario "Budget polls should not appear in the list" do
poll = create(:poll)
budget_poll = create(:poll, :for_budget)
login_as(create(:administrator).user)
visit admin_polls_path
expect(page).to have_content(poll.name)
expect(page).not_to have_content(budget_poll.name)
end
end
end