Skip to content

Commit

Permalink
Move creation of test user to global before/after hook
Browse files Browse the repository at this point in the history
  • Loading branch information
csutter committed Jun 20, 2024
1 parent f47fa92 commit 919e0eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 9 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@

config.include FactoryBot::Syntax::Methods

config.before(:all, type: :system) do
@user = create(:user)
GDS::SSO.test_user = @user
end

config.after(:all, type: :system) do
@user.destroy!
end

config.before(:each, type: :system) do
driven_by :rack_test
end
Expand Down
4 changes: 0 additions & 4 deletions spec/system/recommended_links_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
RSpec.describe "Recommended links" do
before do
# TODO: Refactor me out into a support file (once we have more system specs and old
# controller specs are gone that this might conflict with)
GDS::SSO.test_user = create(:user)

stub_external_content_publisher
end

Expand Down

0 comments on commit 919e0eb

Please sign in to comment.