diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/migrations/20200728182311_add_o_auth_paths_to_protected_paths_spec.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/migrations/20200728182311_add_o_auth_paths_to_protected_paths_spec.rb')
-rw-r--r-- | spec/migrations/20200728182311_add_o_auth_paths_to_protected_paths_spec.rb | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/spec/migrations/20200728182311_add_o_auth_paths_to_protected_paths_spec.rb b/spec/migrations/20200728182311_add_o_auth_paths_to_protected_paths_spec.rb deleted file mode 100644 index 5c65d45c6e0..00000000000 --- a/spec/migrations/20200728182311_add_o_auth_paths_to_protected_paths_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration!('add_o_auth_paths_to_protected_paths') - -RSpec.describe AddOAuthPathsToProtectedPaths do - subject(:migration) { described_class.new } - - let(:application_settings) { table(:application_settings) } - let(:new_paths) do - [ - '/oauth/authorize', - '/oauth/token' - ] - end - - it 'appends new OAuth paths' do - application_settings.create! - - protected_paths_before = application_settings.first.protected_paths - protected_paths_after = protected_paths_before + new_paths - - expect { migrate! }.to change { application_settings.first.protected_paths }.from(protected_paths_before).to(protected_paths_after) - end - - it 'new default includes new paths' do - settings_before = application_settings.create! - - expect(settings_before.protected_paths).not_to include(*new_paths) - - migrate! - - application_settings.reset_column_information - settings_after = application_settings.create! - - expect(settings_after.protected_paths).to include(*new_paths) - end - - it 'does not change the value when the new paths are already included' do - application_settings.create!(protected_paths: %w(/users/sign_in /users/password) + new_paths) - - expect { migrate! }.not_to change { application_settings.first.protected_paths } - end - - it 'adds one value when the other is already present' do - application_settings.create!(protected_paths: %W(/users/sign_in /users/password #{new_paths.first})) - - migrate! - - expect(application_settings.first.protected_paths).to include(new_paths.second) - end -end |