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,7 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe "Admin Notifications" do
|
||||
before do
|
||||
create(:budget)
|
||||
login_as(create(:administrator).user)
|
||||
end
|
||||
describe "Admin Notifications", :admin do
|
||||
before { create(:budget) }
|
||||
|
||||
context "Show" do
|
||||
scenario "Valid Admin Notification" do
|
||||
|
||||
Reference in New Issue
Block a user