From f3e9df531eba44fdccb82353045b351121ff2e93 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Mon, 8 Jun 2015 14:03:07 +0300 Subject: Fix of creation project with the same name --- spec/support/stub_gitlab_calls.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'spec/support/stub_gitlab_calls.rb') 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 -- cgit v1.2.1