summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-09-14 14:04:08 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-09-14 14:04:08 +0200
commitf31d8ef2875c05ef2e254b637889b804990633c5 (patch)
treea1dc89f111c5d7cb53d50953d307b1d0b312eaca /spec/support
parent1ce85dc4e2a1b162a0c30349f3594c1aab710708 (diff)
parent4c53cc0ebac36560d806732ff1fefba9206c75f3 (diff)
downloadgitlab-ce-f31d8ef2875c05ef2e254b637889b804990633c5.tar.gz
Merge commit '4c53cc0ebac36560d806732ff1fefba9206c75f3' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-g
* commit '4c53cc0ebac36560d806732ff1fefba9206c75f3': rubocop satisfy Conflicts: app/controllers/ci/builds_controller.rb app/controllers/ci/commits_controller.rb
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/stub_gitlab_calls.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/support/stub_gitlab_calls.rb b/spec/support/stub_gitlab_calls.rb
index fadc3df412b..41e4c3e275b 100644
--- a/spec/support/stub_gitlab_calls.rb
+++ b/spec/support/stub_gitlab_calls.rb
@@ -23,21 +23,21 @@ module StubGitlabCalls
f = File.read(Rails.root.join('spec/support/gitlab_stubs/session.json'))
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'})
+ with(body: "{\"email\":\"test@test.com\",\"password\":\"123456\"}",
+ 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,24 +54,24 @@ 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'}).
- to_return(:status => 200, :body => "", :headers => {})
+ 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'}).
- to_return(:status => 200, :body => "", :headers => {})
+ with(headers: {'Content-Type'=>'application/json'}).
+ to_return(status: 200, body: "", headers: {})
end
def project_hash_array
f = File.read(Rails.root.join('spec/support/gitlab_stubs/projects.json'))
- return JSON.parse f
+ JSON.parse f
end
end