summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--spec/factories/projects.rb2
-rw-r--r--spec/support/stub_gitlab_calls.rb14
3 files changed, 6 insertions, 11 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 24c9614..625a548 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,7 @@ v7.12.0
- Ability to set secret variables for runner
- Dont retry build when push same commit in same ref twice
- Admin area: show amount of runners with last contact less than a minute ago
+ - Fix re-adding project with the same name but different gitlab_id
v7.11.0
- Deploy Jobs API calls
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index f571587..f6cef2d 100644
--- a/spec/factories/projects.rb
+++ b/spec/factories/projects.rb
@@ -42,7 +42,7 @@ FactoryGirl.define do
"git@demo.gitlab.com:gitlab/gitlab-shell#{n}.git"
end
- gitlab_id 8
+ sequence :gitlab_id
factory :project do
token 'iPWx6WM4lhHNedGfBpPJNP'
diff --git a/spec/support/stub_gitlab_calls.rb b/spec/support/stub_gitlab_calls.rb
index 286c6c9..f378219 100644
--- a/spec/support/stub_gitlab_calls.rb
+++ b/spec/support/stub_gitlab_calls.rb
@@ -46,19 +46,13 @@ module StubGitlabCalls
end
def stub_project_8
- f = File.read(Rails.root.join('spec/support/gitlab_stubs/project_8.json'))
-
- stub_request(:get, "#{gitlab_url}api/v3/projects/8.json?private_token=Wvjy2Krpb7y8xi93owUz").
- with(:headers => {'Content-Type'=>'application/json'}).
- to_return(:status => 200, :body => f, :headers => {'Content-Type'=>'application/json'})
+ data = File.read(Rails.root.join('spec/support/gitlab_stubs/project_8.json'))
+ Network.any_instance.stub(:project).and_return(JSON.parse(data))
end
def stub_project_8_hooks
- f = File.read(Rails.root.join('spec/support/gitlab_stubs/project_8_hooks.json'))
-
- stub_request(:get, "#{gitlab_url}api/v3/projects/8/hooks.json?private_token=Wvjy2Krpb7y8xi93owUz").
- with(:headers => {'Content-Type'=>'application/json'}).
- to_return(:status => 200, :body => f, :headers => {'Content-Type'=>'application/json'})
+ data = File.read(Rails.root.join('spec/support/gitlab_stubs/project_8_hooks.json'))
+ Network.any_instance.stub(:project_hooks).and_return(JSON.parse(data))
end
def stub_projects