diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-06-08 14:31:23 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-06-08 21:46:17 +0300 |
commit | faf46534dd833158f26551b05ca9b72c303bb616 (patch) | |
tree | 5c9a14acff59a908b7ed7e2e9bc11cf6d4abbfb8 | |
parent | 9cf7bdf582035bfd0709a45f643ef817bc0a403b (diff) | |
download | gitlab-ci-fix_project_duplication.tar.gz |
update changelogfix_project_duplication
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | spec/factories/projects.rb | 2 | ||||
-rw-r--r-- | spec/support/stub_gitlab_calls.rb | 14 |
3 files changed, 6 insertions, 11 deletions
@@ -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 |