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 ...@@ -229,7 +229,7 @@ class Integration < ApplicationRecord
end end
# used as part of the renaming effort # 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) def self.available_integration_names(**args)
available_services_names(**args) available_services_names(**args)
......
...@@ -157,7 +157,7 @@ class Project < ApplicationRecord ...@@ -157,7 +157,7 @@ class Project < ApplicationRecord
# Project integrations # Project integrations
has_one :asana_integration, class_name: 'Integrations::Asana' has_one :asana_integration, class_name: 'Integrations::Asana'
has_one :assembla_integration, class_name: 'Integrations::Assembla' 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 :bugzilla_service, class_name: 'Integrations::Bugzilla'
has_one :buildkite_service, class_name: 'Integrations::Buildkite' has_one :buildkite_service, class_name: 'Integrations::Buildkite'
has_one :campfire_service, class_name: 'Integrations::Campfire' has_one :campfire_service, class_name: 'Integrations::Campfire'
......
...@@ -384,7 +384,7 @@ project: ...@@ -384,7 +384,7 @@ project:
- hangouts_chat_service - hangouts_chat_service
- unify_circuit_service - unify_circuit_service
- buildkite_service - buildkite_service
- bamboo_service - bamboo_integration
- teamcity_service - teamcity_service
- pushover_service - pushover_service
- jira_service - jira_service
......
...@@ -82,45 +82,45 @@ RSpec.describe Integrations::Bamboo, :use_clean_rails_memory_store_caching do ...@@ -82,45 +82,45 @@ RSpec.describe Integrations::Bamboo, :use_clean_rails_memory_store_caching do
describe 'before_update :reset_password' do describe 'before_update :reset_password' do
context 'when a password was previously set' do context 'when a password was previously set' do
it 'resets password if url changed' do it 'resets password if url changed' do
bamboo_service = service bamboo_integration = service
bamboo_service.bamboo_url = 'http://gitlab1.com' bamboo_integration.bamboo_url = 'http://gitlab1.com'
bamboo_service.save! bamboo_integration.save!
expect(bamboo_service.password).to be_nil expect(bamboo_integration.password).to be_nil
end end
it 'does not reset password if username changed' do it 'does not reset password if username changed' do
bamboo_service = service bamboo_integration = service
bamboo_service.username = 'some_name' bamboo_integration.username = 'some_name'
bamboo_service.save! bamboo_integration.save!
expect(bamboo_service.password).to eq('password') expect(bamboo_integration.password).to eq('password')
end end
it "does not reset password if new url is set together with password, even if it's the same password" do 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_integration.bamboo_url = 'http://gitlab_edited.com'
bamboo_service.password = 'password' bamboo_integration.password = 'password'
bamboo_service.save! bamboo_integration.save!
expect(bamboo_service.password).to eq('password') expect(bamboo_integration.password).to eq('password')
expect(bamboo_service.bamboo_url).to eq('http://gitlab_edited.com') expect(bamboo_integration.bamboo_url).to eq('http://gitlab_edited.com')
end end
end end
it 'saves password if new url is set together with password when no password was previously set' do it 'saves password if new url is set together with password when no password was previously set' do
bamboo_service = service bamboo_integration = service
bamboo_service.password = nil bamboo_integration.password = nil
bamboo_service.bamboo_url = 'http://gitlab_edited.com' bamboo_integration.bamboo_url = 'http://gitlab_edited.com'
bamboo_service.password = 'password' bamboo_integration.password = 'password'
bamboo_service.save! bamboo_integration.save!
expect(bamboo_service.password).to eq('password') expect(bamboo_integration.password).to eq('password')
expect(bamboo_service.bamboo_url).to eq('http://gitlab_edited.com') expect(bamboo_integration.bamboo_url).to eq('http://gitlab_edited.com')
end end
end end
end end
......
...@@ -58,7 +58,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -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(:slack_slash_commands_service) }
it { is_expected.to have_one(:mattermost_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(: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(:teamcity_service) }
it { is_expected.to have_one(:jira_service) } it { is_expected.to have_one(:jira_service) }
it { is_expected.to have_one(:redmine_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