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,12 +1,6 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe "Admin dashboard actions" do
|
||||
let(:admin) { create :administrator }
|
||||
|
||||
before do
|
||||
login_as(admin.user)
|
||||
end
|
||||
|
||||
describe "Admin dashboard actions", :admin do
|
||||
it_behaves_like "nested documentable",
|
||||
"administrator",
|
||||
"dashboard_action",
|
||||
|
||||
Reference in New Issue
Block a user