diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-09-15 15:51:03 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-09-15 15:51:03 +0300 |
commit | e2cbb36ba9751021174fd188d1c29e736f7b5d3d (patch) | |
tree | 3515122e7480e80b68c7d527d6cc88529148dfae /spec/support/stub_gitlab_calls.rb | |
parent | 16ba41a186d5ff393f7d1e3ac1b94fba485aad12 (diff) | |
download | gitlab-ce-e2cbb36ba9751021174fd188d1c29e736f7b5d3d.tar.gz |
fix specs. Stage 5
Diffstat (limited to 'spec/support/stub_gitlab_calls.rb')
-rw-r--r-- | spec/support/stub_gitlab_calls.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/support/stub_gitlab_calls.rb b/spec/support/stub_gitlab_calls.rb index 41e4c3e275b..5e6744afda1 100644 --- a/spec/support/stub_gitlab_calls.rb +++ b/spec/support/stub_gitlab_calls.rb @@ -24,20 +24,20 @@ module StubGitlabCalls stub_request(:post, "#{gitlab_url}api/v3/session.json"). with(body: "{\"email\":\"test@test.com\",\"password\":\"123456\"}", - headers: {'Content-Type'=>'application/json'}). - to_return(status: 201, body: f, headers: {'Content-Type'=>'application/json'}) + headers: { 'Content-Type'=>'application/json' }). + to_return(status: 201, body: f, headers: { 'Content-Type'=>'application/json' }) end def stub_user f = File.read(Rails.root.join('spec/support/gitlab_stubs/user.json')) stub_request(:get, "#{gitlab_url}api/v3/user?private_token=Wvjy2Krpb7y8xi93owUz"). - with(headers: {'Content-Type'=>'application/json'}). - to_return(status: 200, body: f, headers: {'Content-Type'=>'application/json'}) + with(headers: { 'Content-Type'=>'application/json' }). + to_return(status: 200, body: f, headers: { 'Content-Type'=>'application/json' }) stub_request(:get, "#{gitlab_url}api/v3/user?access_token=some_token"). - with(headers: {'Content-Type'=>'application/json'}). - to_return(status: 200, body: f, headers: {'Content-Type'=>'application/json'}) + with(headers: { 'Content-Type'=>'application/json' }). + to_return(status: 200, body: f, headers: { 'Content-Type'=>'application/json' }) end def stub_project_8 @@ -54,19 +54,19 @@ module StubGitlabCalls f = File.read(Rails.root.join('spec/support/gitlab_stubs/projects.json')) stub_request(:get, "#{gitlab_url}api/v3/projects.json?archived=false&ci_enabled_first=true&private_token=Wvjy2Krpb7y8xi93owUz"). - with(headers: {'Content-Type'=>'application/json'}). - to_return(status: 200, body: f, headers: {'Content-Type'=>'application/json'}) + with(headers: { 'Content-Type'=>'application/json' }). + to_return(status: 200, body: f, headers: { 'Content-Type'=>'application/json' }) end def stub_projects_owned stub_request(:get, "#{gitlab_url}api/v3/projects/owned.json?archived=false&ci_enabled_first=true&private_token=Wvjy2Krpb7y8xi93owUz"). - with(headers: {'Content-Type'=>'application/json'}). + with(headers: { 'Content-Type'=>'application/json' }). to_return(status: 200, body: "", headers: {}) end def stub_ci_enable stub_request(:put, "#{gitlab_url}api/v3/projects/2/services/gitlab-ci.json?private_token=Wvjy2Krpb7y8xi93owUz"). - with(headers: {'Content-Type'=>'application/json'}). + with(headers: { 'Content-Type'=>'application/json' }). to_return(status: 200, body: "", headers: {}) end |