Simplify tests requiring admin login
We were repeating the same code over and over (with a few variants) to setup tests which require an administrator. We can use a tag and simplify the code.
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe "Admin poll questions" do
|
||||
before do
|
||||
login_as(create(:administrator).user)
|
||||
end
|
||||
|
||||
describe "Admin poll questions", :admin do
|
||||
scenario "Index" do
|
||||
poll1 = create(:poll)
|
||||
poll2 = create(:poll)
|
||||
|
||||
Reference in New Issue
Block a user