diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/models/integrations/bamboo_spec.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/models/integrations/bamboo_spec.rb')
-rw-r--r-- | spec/models/integrations/bamboo_spec.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/models/integrations/bamboo_spec.rb b/spec/models/integrations/bamboo_spec.rb index 73ebf404828..60ff6685c3d 100644 --- a/spec/models/integrations/bamboo_spec.rb +++ b/spec/models/integrations/bamboo_spec.rb @@ -12,6 +12,7 @@ RSpec.describe Integrations::Bamboo, :use_clean_rails_memory_store_caching do subject(:integration) do described_class.create!( + active: true, project: project, properties: { bamboo_url: bamboo_url, @@ -74,27 +75,27 @@ RSpec.describe Integrations::Bamboo, :use_clean_rails_memory_store_caching do end describe 'Callbacks' do - describe 'before_update :reset_password' do + describe 'before_validation :reset_password' do context 'when a password was previously set' do it 'resets password if url changed' do integration.bamboo_url = 'http://gitlab1.com' - integration.save! + expect(integration).not_to be_valid expect(integration.password).to be_nil end it 'does not reset password if username changed' do integration.username = 'some_name' - integration.save! + expect(integration).to be_valid expect(integration.password).to eq('password') end it "does not reset password if new url is set together with password, even if it's the same password" do integration.bamboo_url = 'http://gitlab_edited.com' integration.password = 'password' - integration.save! + expect(integration).to be_valid expect(integration.password).to eq('password') expect(integration.bamboo_url).to eq('http://gitlab_edited.com') end @@ -107,8 +108,10 @@ RSpec.describe Integrations::Bamboo, :use_clean_rails_memory_store_caching do integration.password = 'password' integration.save! - expect(integration.password).to eq('password') - expect(integration.bamboo_url).to eq('http://gitlab_edited.com') + expect(integration.reload).to have_attributes( + bamboo_url: 'http://gitlab_edited.com', + password: 'password' + ) end end end |