Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/integrations/bamboo_spec.rb')
-rw-r--r--spec/models/integrations/bamboo_spec.rb46
1 files changed, 4 insertions, 42 deletions
diff --git a/spec/models/integrations/bamboo_spec.rb b/spec/models/integrations/bamboo_spec.rb
index e92226d109f..1d2c90dad51 100644
--- a/spec/models/integrations/bamboo_spec.rb
+++ b/spec/models/integrations/bamboo_spec.rb
@@ -23,6 +23,10 @@ RSpec.describe Integrations::Bamboo, :use_clean_rails_memory_store_caching do
)
end
+ it_behaves_like Integrations::BaseCi
+
+ it_behaves_like Integrations::ResetSecretFields
+
include_context Integrations::EnableSslVerification
describe 'Validations' do
@@ -77,48 +81,6 @@ RSpec.describe Integrations::Bamboo, :use_clean_rails_memory_store_caching do
end
end
- describe 'Callbacks' 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'
-
- 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'
-
- 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'
-
- expect(integration).to be_valid
- expect(integration.password).to eq('password')
- expect(integration.bamboo_url).to eq('http://gitlab_edited.com')
- end
- end
-
- it 'saves password if new url is set together with password when no password was previously set' do
- integration.password = nil
-
- integration.bamboo_url = 'http://gitlab_edited.com'
- integration.password = 'password'
- integration.save!
-
- expect(integration.reload).to have_attributes(
- bamboo_url: 'http://gitlab_edited.com',
- password: 'password'
- )
- end
- end
- end
-
describe '#execute' do
it 'runs update and build action' do
stub_update_and_build_request