diff options
-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) |