diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-22 18:10:32 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 18:31:57 +0300 |
commit | 5c7f9d69e3db27921acf6d8259245f2b4babcc2b (patch) | |
tree | b90334ce234ddd3921e0f1780cf3bb0848adff7b /spec | |
parent | 02494f7ce86fbf1276b384f45f58558c427eff63 (diff) |
Fix code for cops
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/issuables/issuable_list_spec.rb | 11 | ||||
-rw-r--r-- | spec/helpers/issues_helper_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/global_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/job_spec.rb | 10 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/status/build/factory_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/incoming_email_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/o_auth/user_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/saml/user_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/ci/build_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/issuables_list_metadata_shared_examples.rb | 11 | ||||
-rw-r--r-- | spec/support/login_helpers.rb | 11 |
11 files changed, 35 insertions, 32 deletions
diff --git a/spec/features/issuables/issuable_list_spec.rb b/spec/features/issuables/issuable_list_spec.rb index 2867fcf8819..b90bf6268fd 100644 --- a/spec/features/issuables/issuable_list_spec.rb +++ b/spec/features/issuables/issuable_list_spec.rb @@ -47,11 +47,12 @@ describe 'issuable list', feature: true do def create_issuables(issuable_type) 3.times do - issuable = if issuable_type == :issue - create(:issue, project: project, author: user) - else - create(:merge_request, title: FFaker::Lorem.sentence, source_project: project, source_branch: FFaker::Name.name) - end + issuable = + if issuable_type == :issue + create(:issue, project: project, author: user) + else + create(:merge_request, title: FFaker::Lorem.sentence, source_project: project, source_branch: FFaker::Name.name) + end 2.times do create(:note_on_issue, noteable: issuable, project: project, note: 'Test note') diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb index 372546e92a5..4a9cbba69f9 100644 --- a/spec/helpers/issues_helper_spec.rb +++ b/spec/helpers/issues_helper_spec.rb @@ -56,7 +56,7 @@ describe IssuesHelper do subject { merge_requests_sentence(merge_requests)} let(:merge_requests) do [build(:merge_request, iid: 1), build(:merge_request, iid: 2), - build(:merge_request, iid: 3)] + build(:merge_request, iid: 3)] end it { is_expected.to eq("!1, !2, or !3") } diff --git a/spec/lib/gitlab/ci/config/entry/global_spec.rb b/spec/lib/gitlab/ci/config/entry/global_spec.rb index c3551a149ed..3b2d043301e 100644 --- a/spec/lib/gitlab/ci/config/entry/global_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/global_spec.rb @@ -12,8 +12,8 @@ describe Gitlab::Ci::Config::Entry::Global do it 'contains the expected node names' do expect(described_class.nodes.keys). to match_array(%i[before_script image services - after_script variables stages - types cache]) + after_script variables stages + types cache]) end end end diff --git a/spec/lib/gitlab/ci/config/entry/job_spec.rb b/spec/lib/gitlab/ci/config/entry/job_spec.rb index b90308a0515..82feff0af1c 100644 --- a/spec/lib/gitlab/ci/config/entry/job_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/job_spec.rb @@ -140,11 +140,11 @@ describe Gitlab::Ci::Config::Entry::Job do it 'returns correct value' do expect(entry.value). to eq(name: :rspec, - before_script: %w[ls pwd], - script: %w[rspec], - commands: "ls\npwd\nrspec", - stage: 'test', - after_script: %w[cleanup]) + before_script: %w[ls pwd], + script: %w[rspec], + commands: "ls\npwd\nrspec", + stage: 'test', + after_script: %w[cleanup]) end end end diff --git a/spec/lib/gitlab/ci/status/build/factory_spec.rb b/spec/lib/gitlab/ci/status/build/factory_spec.rb index 3d1ebadadcc..aa026a66460 100644 --- a/spec/lib/gitlab/ci/status/build/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/build/factory_spec.rb @@ -69,7 +69,7 @@ describe Gitlab::Ci::Status::Build::Factory do it 'matches correct extended statuses' do expect(factory.extended_statuses). to eq [Gitlab::Ci::Status::Build::Retryable, - Gitlab::Ci::Status::Build::FailedAllowed] + Gitlab::Ci::Status::Build::FailedAllowed] end it 'fabricates a failed but allowed build status' do diff --git a/spec/lib/gitlab/incoming_email_spec.rb b/spec/lib/gitlab/incoming_email_spec.rb index 06d39d5c782..d54753ccf90 100644 --- a/spec/lib/gitlab/incoming_email_spec.rb +++ b/spec/lib/gitlab/incoming_email_spec.rb @@ -101,8 +101,8 @@ describe Gitlab::IncomingEmail, lib: true do it 'returns reply key' do expect(described_class.scan_fallback_references(references)). to eq(%w[issue_1@localhost - reply-59d8df8370b7e95c5a49fbf86aeb2c93@localhost - exchange@microsoft.com]) + reply-59d8df8370b7e95c5a49fbf86aeb2c93@localhost + exchange@microsoft.com]) end end end diff --git a/spec/lib/gitlab/o_auth/user_spec.rb b/spec/lib/gitlab/o_auth/user_spec.rb index 0575b95fd30..2c07c37b0ea 100644 --- a/spec/lib/gitlab/o_auth/user_spec.rb +++ b/spec/lib/gitlab/o_auth/user_spec.rb @@ -152,7 +152,7 @@ describe Gitlab::OAuth::User, lib: true do identities_as_hash = gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } } expect(identities_as_hash).to match_array( [{ provider: 'ldapmain', extern_uid: 'uid=user1,ou=People,dc=example' }, - { provider: 'twitter', extern_uid: uid } + { provider: 'twitter', extern_uid: uid } ]) end end @@ -171,7 +171,7 @@ describe Gitlab::OAuth::User, lib: true do identities_as_hash = gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } } expect(identities_as_hash).to match_array( [{ provider: 'ldapmain', extern_uid: 'uid=user1,ou=People,dc=example' }, - { provider: 'twitter', extern_uid: uid } + { provider: 'twitter', extern_uid: uid } ]) end end diff --git a/spec/lib/gitlab/saml/user_spec.rb b/spec/lib/gitlab/saml/user_spec.rb index 844b9446603..00dd29f3e5d 100644 --- a/spec/lib/gitlab/saml/user_spec.rb +++ b/spec/lib/gitlab/saml/user_spec.rb @@ -158,7 +158,7 @@ describe Gitlab::Saml::User, lib: true do expect(gl_user.identities.length).to eql 2 identities_as_hash = gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } } expect(identities_as_hash).to match_array([{ provider: 'ldapmain', extern_uid: 'uid=user1,ou=People,dc=example' }, - { provider: 'saml', extern_uid: uid } + { provider: 'saml', extern_uid: uid } ]) end end @@ -181,7 +181,7 @@ describe Gitlab::Saml::User, lib: true do expect(gl_user.identities.length).to eql 2 identities_as_hash = gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } } expect(identities_as_hash).to match_array([{ provider: 'ldapmain', extern_uid: 'uid=user1,ou=People,dc=example' }, - { provider: 'saml', extern_uid: uid } + { provider: 'saml', extern_uid: uid } ]) end @@ -207,7 +207,7 @@ describe Gitlab::Saml::User, lib: true do expect(local_gl_user.identities.length).to eql 2 identities_as_hash = local_gl_user.identities.map { |id| { provider: id.provider, extern_uid: id.extern_uid } } expect(identities_as_hash).to match_array([{ provider: 'ldapmain', extern_uid: 'uid=user1,ou=People,dc=example' }, - { provider: 'saml', extern_uid: 'uid=user1,ou=People,dc=example' } + { provider: 'saml', extern_uid: 'uid=user1,ou=People,dc=example' } ]) end end diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 2611a0be92f..eaff27efd5d 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1263,7 +1263,7 @@ describe Ci::Build, :models do context 'when build has user' do let(:user_variables) do [{ key: 'GITLAB_USER_ID', value: user.id.to_s, public: true }, - { key: 'GITLAB_USER_EMAIL', value: user.email, public: true }] + { key: 'GITLAB_USER_EMAIL', value: user.email, public: true }] end before do diff --git a/spec/support/issuables_list_metadata_shared_examples.rb b/spec/support/issuables_list_metadata_shared_examples.rb index c61f3e05cea..4644c7a6b86 100644 --- a/spec/support/issuables_list_metadata_shared_examples.rb +++ b/spec/support/issuables_list_metadata_shared_examples.rb @@ -3,11 +3,12 @@ shared_examples 'issuables list meta-data' do |issuable_type, action = nil| @issuable_ids = [] 2.times do - issuable = if issuable_type == :issue - create(issuable_type, project: project) - else - create(issuable_type, title: FFaker::Lorem.sentence, source_project: project, source_branch: FFaker::Name.name) - end + issuable = + if issuable_type == :issue + create(issuable_type, project: project) + else + create(issuable_type, title: FFaker::Lorem.sentence, source_project: project, source_branch: FFaker::Name.name) + end @issuable_ids << issuable.id diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb index b94ffa30736..dd4c7287655 100644 --- a/spec/support/login_helpers.rb +++ b/spec/support/login_helpers.rb @@ -15,11 +15,12 @@ module LoginHelpers # user = create(:user) # login_as(user) def login_as(user_or_role) - @user = if user_or_role.kind_of?(User) - user_or_role - else - create(user_or_role) - end + @user = + if user_or_role.kind_of?(User) + user_or_role + else + create(user_or_role) + end login_with(@user) end |