diff --git a/spec/apps/dummy/config/initializers/scimitar.rb b/spec/apps/dummy/config/initializers/scimitar.rb index d165b76..a639626 100644 --- a/spec/apps/dummy/config/initializers/scimitar.rb +++ b/spec/apps/dummy/config/initializers/scimitar.rb @@ -27,10 +27,6 @@ def scim_schemas_url(options) def scim_resource_type_url(options) super(test: 1, **options) end - - def valid_token - 'A' - end end }) diff --git a/spec/controllers/scimitar/application_controller_spec.rb b/spec/controllers/scimitar/application_controller_spec.rb index 27dd958..317996d 100644 --- a/spec/controllers/scimitar/application_controller_spec.rb +++ b/spec/controllers/scimitar/application_controller_spec.rb @@ -120,10 +120,14 @@ def index def index render json: { 'message' => 'cool, cool!' }, format: :scim end + + def valid_token + 'B' + end end it 'renders success when valid creds are given' do - request.env['HTTP_AUTHORIZATION'] = 'Bearer A' + request.env['HTTP_AUTHORIZATION'] = 'Bearer B' get :index, params: { format: :scim } expect(response).to be_ok diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 05aa815..2dc029c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -38,6 +38,13 @@ config.use_transactional_fixtures = true Kernel.srand config.seed + + config.around :each do | example | + original_engine_configuration = Scimitar.instance_variable_get('@engine_configuration') + example.run() + ensure + Scimitar.instance_variable_set('@engine_configuration', original_engine_configuration) + end end # ============================================================================