diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 2c534265ff..fadc1d13b8 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -63,6 +63,18 @@ config.filter_rails_from_backtrace! # arbitrary gems may also be filtered via: # config.filter_gems_from_backtrace("gem name") + + config.around(:each, type: :request) do |example| + host! ENV['CLAIMS_HOST'] + example.run + host! nil + end + + config.around(:each, type: :system) do |example| + Capybara.app_host = "http://#{ENV['CLAIMS_HOST']}" + example.run + Capybara.app_host = nil + end end Shoulda::Matchers.configure do |config| diff --git a/spec/requests/sessions_spec.rb b/spec/requests/sessions_spec.rb index 4d85561a6d..b0b231ae5d 100644 --- a/spec/requests/sessions_spec.rb +++ b/spec/requests/sessions_spec.rb @@ -1,27 +1,23 @@ require "rails_helper" RSpec.describe "Sessions", type: :request do - around do |example| - host! ENV["PLACEMENTS_HOST"] - example.run - host! nil - end - describe "POST /auth/developer/callback" do it "returns http success" do - placements_user = create(:placements_user) - post auth_developer_callback_path, + claims_user = create(:claims_user) + + post "/auth/developer/callback", params: { - first_name: placements_user.first_name, - last_name: placements_user.last_name, - email: placements_user.email + first_name: claims_user.first_name, + last_name: claims_user.last_name, + email: claims_user.email } + follow_redirect! expect(response).to have_http_status(:success) # TODO: Change render_template once redirect to service specific # roots implemented - expect(response).to render_template("placements/pages/index") + expect(response).to render_template("claims/pages/index") end end end