Skip to content

Commit

Permalink
Don't talk to db when generating headers for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Butz committed Jul 29, 2020
1 parent c28ccd3 commit 214fda4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions spec/support/controller_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,36 +97,32 @@ def entity

def admin_headers
if !@admin_headers
user = User.make
user = User.make_unsaved
@admin_headers = headers_for(user, scopes: %w(cloud_controller.admin))
user.destroy
end
@admin_headers
end

def admin_read_only_headers
if !@admin_read_only_headers
user = User.make
user = User.make_unsaved
@admin_read_only_headers = headers_for(user, scopes: %w(cloud_controller.admin_read_only))
user.destroy
end
@admin_read_only_headers
end

def global_auditor_headers
if !@global_auditor_headers
user = User.make
user = User.make_unsaved
@global_auditor_headers = headers_for(user, scopes: %w(cloud_controller.global_auditor))
user.destroy
end
@global_auditor_headers
end

def build_state_updater_headers
if !@build_state_updater_headers
user = User.make
user = User.make_unsaved
@build_state_updater_headers = headers_for(user, scopes: %w(cloud_controller.write cloud_controller.update_build_state))
user.destroy
end
@build_state_updater_headers
end
Expand Down

0 comments on commit 214fda4

Please sign in to comment.