diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-11-29 09:48:17 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-11-29 09:48:17 +0000 |
commit | 299011313cef8fbeb8d5eeafcc60374211c88ec8 (patch) | |
tree | 198ca3baa64cb862574f5b39d17de3b2e9cb6ccf | |
parent | 901d078dc33f7ab4f119d0eee71144ca5c98251d (diff) | |
parent | 207f0a1b16a886aec0af57805264f64ff9d21b19 (diff) | |
download | gitlab-ce-299011313cef8fbeb8d5eeafcc60374211c88ec8.tar.gz |
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
-rw-r--r-- | app/models/remote_mirror.rb | 2 | ||||
-rw-r--r-- | spec/models/remote_mirror_spec.rb | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/models/remote_mirror.rb b/app/models/remote_mirror.rb index a3415a4a14c..b7b4d0f1be9 100644 --- a/app/models/remote_mirror.rb +++ b/app/models/remote_mirror.rb @@ -15,8 +15,6 @@ class RemoteMirror < ActiveRecord::Base insecure_mode: true, algorithm: 'aes-256-cbc' - default_value_for :only_protected_branches, true - belongs_to :project, inverse_of: :remote_mirrors validates :url, presence: true, url: { protocols: %w(ssh git http https), allow_blank: true, enforce_user: true } diff --git a/spec/models/remote_mirror_spec.rb b/spec/models/remote_mirror_spec.rb index da61a5f2771..b12ca79847c 100644 --- a/spec/models/remote_mirror_spec.rb +++ b/spec/models/remote_mirror_spec.rb @@ -174,7 +174,15 @@ describe RemoteMirror do end 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 + before do + remote_mirror.only_protected_branches = true + end + context 'when it did not update in the last minute' do it 'schedules a RepositoryUpdateRemoteMirrorWorker to run now' do expect(RepositoryUpdateRemoteMirrorWorker).to receive(:perform_async).with(remote_mirror.id, Time.now) |