Commit b8293b2f authored by Alex Kalderimis's avatar Alex Kalderimis

Rename bamboo service

Renames `bamboo_service` to `bamboo_integration`
parent a16d508e
......@@ -229,7 +229,7 @@ class Integration < ApplicationRecord
end
# used as part of the renaming effort
RENAMED_TO_INTEGRATION = %w[asana assembla]
RENAMED_TO_INTEGRATION = %w[asana assembla bamboo].freeze
def self.available_integration_names(**args)
available_services_names(**args)
......
......@@ -157,7 +157,7 @@ class Project < ApplicationRecord
# Project integrations
has_one :asana_integration, class_name: 'Integrations::Asana'
has_one :assembla_integration, class_name: 'Integrations::Assembla'
has_one :bamboo_service, class_name: 'Integrations::Bamboo'
has_one :bamboo_integration, class_name: 'Integrations::Bamboo'
has_one :bugzilla_service, class_name: 'Integrations::Bugzilla'
has_one :buildkite_service, class_name: 'Integrations::Buildkite'
has_one :campfire_service, class_name: 'Integrations::Campfire'
......
......@@ -384,7 +384,7 @@ project:
- hangouts_chat_service
- unify_circuit_service
- buildkite_service
- bamboo_service
- bamboo_integration
- teamcity_service
- pushover_service
- jira_service
......
......@@ -82,45 +82,45 @@ RSpec.describe Integrations::Bamboo, :use_clean_rails_memory_store_caching do
describe 'before_update :reset_password' do
context 'when a password was previously set' do
it 'resets password if url changed' do
bamboo_service = service
bamboo_integration = service
bamboo_service.bamboo_url = 'http://gitlab1.com'
bamboo_service.save!
bamboo_integration.bamboo_url = 'http://gitlab1.com'
bamboo_integration.save!
expect(bamboo_service.password).to be_nil
expect(bamboo_integration.password).to be_nil
end
it 'does not reset password if username changed' do
bamboo_service = service
bamboo_integration = service
bamboo_service.username = 'some_name'
bamboo_service.save!
bamboo_integration.username = 'some_name'
bamboo_integration.save!
expect(bamboo_service.password).to eq('password')
expect(bamboo_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
bamboo_service = service
bamboo_integration = service
bamboo_service.bamboo_url = 'http://gitlab_edited.com'
bamboo_service.password = 'password'
bamboo_service.save!
bamboo_integration.bamboo_url = 'http://gitlab_edited.com'
bamboo_integration.password = 'password'
bamboo_integration.save!
expect(bamboo_service.password).to eq('password')
expect(bamboo_service.bamboo_url).to eq('http://gitlab_edited.com')
expect(bamboo_integration.password).to eq('password')
expect(bamboo_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
bamboo_service = service
bamboo_service.password = nil
bamboo_integration = service
bamboo_integration.password = nil
bamboo_service.bamboo_url = 'http://gitlab_edited.com'
bamboo_service.password = 'password'
bamboo_service.save!
bamboo_integration.bamboo_url = 'http://gitlab_edited.com'
bamboo_integration.password = 'password'
bamboo_integration.save!
expect(bamboo_service.password).to eq('password')
expect(bamboo_service.bamboo_url).to eq('http://gitlab_edited.com')
expect(bamboo_integration.password).to eq('password')
expect(bamboo_integration.bamboo_url).to eq('http://gitlab_edited.com')
end
end
end
......
......@@ -58,7 +58,7 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_one(:slack_slash_commands_service) }
it { is_expected.to have_one(:mattermost_slash_commands_service) }
it { is_expected.to have_one(:buildkite_service) }
it { is_expected.to have_one(:bamboo_service) }
it { is_expected.to have_one(:bamboo_integration) }
it { is_expected.to have_one(:teamcity_service) }
it { is_expected.to have_one(:jira_service) }
it { is_expected.to have_one(:redmine_service) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment