summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-05-03 15:19:21 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-05-07 12:00:13 +0200
commit961255b107370a1350f91d0835cf0e849d237f7d (patch)
tree74690c9c0df07f86a6acccc5b7ebc51d310fefa2 /spec/models
parent9a13059332a0c81b3a953f57bb9e40346eba951d (diff)
downloadgitlab-ce-961255b107370a1350f91d0835cf0e849d237f7d.tar.gz
Adds remote mirror table migration
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_spec.rb2
-rw-r--r--spec/models/remote_mirror_spec.rb8
-rw-r--r--spec/models/repository_spec.rb5
3 files changed, 6 insertions, 9 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 8015c0926b6..41622fbbb6f 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -1852,7 +1852,7 @@ describe Project do
it { expect(project.gitea_import?).to be true }
end
- describe '#has_remote_mirror?' do
+ describe '#has_remote_mirror?' do
let(:project) { create(:project, :remote_mirror, :import_started) }
subject { project.has_remote_mirror? }
diff --git a/spec/models/remote_mirror_spec.rb b/spec/models/remote_mirror_spec.rb
index d6181ca0783..a80800c6c92 100644
--- a/spec/models/remote_mirror_spec.rb
+++ b/spec/models/remote_mirror_spec.rb
@@ -164,14 +164,6 @@ describe RemoteMirror do
end
end
- context 'as a Geo secondary' do
- it 'returns nil' do
- allow(Gitlab::Geo).to receive(:secondary?).and_return(true)
-
- expect(remote_mirror.sync).to be_nil
- end
- end
-
context 'with remote mirroring enabled' do
context 'with only protected branches enabled' do
context 'when it did not update in the last minute' do
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 44d9ffd258d..4b736b02b7d 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -2370,6 +2370,11 @@ describe Repository do
end
end
+ def create_remote_branch(remote_name, branch_name, target)
+ rugged = repository.rugged
+ rugged.references.create("refs/remotes/#{remote_name}/#{branch_name}", target.id)
+ end
+
describe '#ancestor?' do
let(:commit) { repository.commit }
let(:ancestor) { commit.parents.first }