diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-22 16:00:54 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-22 16:00:54 -0400 |
commit | 15a05be70d7652a98f870c5b5d02373dabf363e0 (patch) | |
tree | 970f32c6d3fb705c5626b503dee5e683049f5c8e /spec/controllers/import | |
parent | 88328392918deeb459c1d991559f9b40b5fc1026 (diff) | |
download | gitlab-ce-15a05be70d7652a98f870c5b5d02373dabf363e0.tar.gz |
Fix Style/Blocks cop violations
Diffstat (limited to 'spec/controllers/import')
-rw-r--r-- | spec/controllers/import/bitbucket_controller_spec.rb | 23 | ||||
-rw-r--r-- | spec/controllers/import/github_controller_spec.rb | 16 | ||||
-rw-r--r-- | spec/controllers/import/gitlab_controller_spec.rb | 14 |
3 files changed, 21 insertions, 32 deletions
diff --git a/spec/controllers/import/bitbucket_controller_spec.rb b/spec/controllers/import/bitbucket_controller_spec.rb index c31563e6d77..ddeeaf74fcb 100644 --- a/spec/controllers/import/bitbucket_controller_spec.rb +++ b/spec/controllers/import/bitbucket_controller_spec.rb @@ -12,7 +12,7 @@ describe Import::BitbucketController do before do session[:oauth_request_token] = {} end - + it "updates access token" do token = "asdasd12345" secret = "sekrettt" @@ -57,20 +57,13 @@ describe Import::BitbucketController do describe "POST create" do let(:bitbucket_username) { user.username } - let(:bitbucket_user) { - { - user: { - username: bitbucket_username - } - }.with_indifferent_access - } - - let(:bitbucket_repo) { - { - slug: "vim", - owner: bitbucket_username - }.with_indifferent_access - } + let(:bitbucket_user) do + { user: { username: bitbucket_username } }.with_indifferent_access + end + + let(:bitbucket_repo) do + { slug: "vim", owner: bitbucket_username }.with_indifferent_access + end before do allow(Gitlab::BitbucketImport::KeyAdder). diff --git a/spec/controllers/import/github_controller_spec.rb b/spec/controllers/import/github_controller_spec.rb index 3d3846b2e3a..5f2a09280b2 100644 --- a/spec/controllers/import/github_controller_spec.rb +++ b/spec/controllers/import/github_controller_spec.rb @@ -57,14 +57,14 @@ describe Import::GithubController do describe "POST create" do let(:github_username) { user.username } - - let(:github_user) { - OpenStruct.new(login: github_username) - } - - let(:github_repo) { - OpenStruct.new(name: 'vim', full_name: "#{github_username}/vim", owner: OpenStruct.new(login: github_username)) - } + let(:github_user) { OpenStruct.new(login: github_username) } + let(:github_repo) do + OpenStruct.new( + name: 'vim', + full_name: "#{github_username}/vim", + owner: OpenStruct.new(login: github_username) + ) + end before do controller.stub_chain(:client, :user).and_return(github_user) diff --git a/spec/controllers/import/gitlab_controller_spec.rb b/spec/controllers/import/gitlab_controller_spec.rb index 112e51d431e..a0c5ce1fe5b 100644 --- a/spec/controllers/import/gitlab_controller_spec.rb +++ b/spec/controllers/import/gitlab_controller_spec.rb @@ -49,21 +49,17 @@ describe Import::GitlabController do describe "POST create" do let(:gitlab_username) { user.username } - - let(:gitlab_user) { - { - username: gitlab_username - }.with_indifferent_access - } - - let(:gitlab_repo) { + let(:gitlab_user) do + { username: gitlab_username }.with_indifferent_access + end + let(:gitlab_repo) do { path: 'vim', path_with_namespace: "#{gitlab_username}/vim", owner: { name: gitlab_username }, namespace: { path: gitlab_username } }.with_indifferent_access - } + end before do controller.stub_chain(:client, :user).and_return(gitlab_user) |