Merge branch 'sh-remove-default-value-remote-mirror' into 'master'
Make RemoteMirror's only_protected_branches default value consistent See merge request gitlab-org/gitlab-ce!23410
This commit is contained in:
commit
299011313c
|
@ -15,8 +15,6 @@ class RemoteMirror < ActiveRecord::Base
|
||||||
insecure_mode: true,
|
insecure_mode: true,
|
||||||
algorithm: 'aes-256-cbc'
|
algorithm: 'aes-256-cbc'
|
||||||
|
|
||||||
default_value_for :only_protected_branches, true
|
|
||||||
|
|
||||||
belongs_to :project, inverse_of: :remote_mirrors
|
belongs_to :project, inverse_of: :remote_mirrors
|
||||||
|
|
||||||
validates :url, presence: true, url: { protocols: %w(ssh git http https), allow_blank: true, enforce_user: true }
|
validates :url, presence: true, url: { protocols: %w(ssh git http https), allow_blank: true, enforce_user: true }
|
||||||
|
|
|
@ -174,7 +174,15 @@ describe RemoteMirror do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with remote mirroring enabled' do
|
context 'with remote mirroring enabled' do
|
||||||
|
it 'defaults to disabling only protected branches' do
|
||||||
|
expect(remote_mirror.only_protected_branches?).to be_falsey
|
||||||
|
end
|
||||||
|
|
||||||
context 'with only protected branches enabled' do
|
context 'with only protected branches enabled' do
|
||||||
|
before do
|
||||||
|
remote_mirror.only_protected_branches = true
|
||||||
|
end
|
||||||
|
|
||||||
context 'when it did not update in the last minute' do
|
context 'when it did not update in the last minute' do
|
||||||
it 'schedules a RepositoryUpdateRemoteMirrorWorker to run now' do
|
it 'schedules a RepositoryUpdateRemoteMirrorWorker to run now' do
|
||||||
expect(RepositoryUpdateRemoteMirrorWorker).to receive(:perform_async).with(remote_mirror.id, Time.now)
|
expect(RepositoryUpdateRemoteMirrorWorker).to receive(:perform_async).with(remote_mirror.id, Time.now)
|
||||||
|
|
Loading…
Reference in New Issue