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,11 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe "Admin comments" do
|
||||
before do
|
||||
admin = create(:administrator)
|
||||
login_as(admin.user)
|
||||
end
|
||||
|
||||
describe "Admin comments", :admin do
|
||||
scenario "Index" do
|
||||
create(:comment, body: "Everything is awesome")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user