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/models | |
parent | 88328392918deeb459c1d991559f9b40b5fc1026 (diff) | |
download | gitlab-ce-15a05be70d7652a98f870c5b5d02373dabf363e0.tar.gz |
Fix Style/Blocks cop violations
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/deploy_keys_project_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/hooks/service_hook_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/hooks/web_hook_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/project_services/slack_service/issue_message_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/project_services/slack_service/merge_message_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/project_services/slack_service/push_message_spec.rb | 20 | ||||
-rw-r--r-- | spec/models/service_spec.rb | 13 |
7 files changed, 27 insertions, 26 deletions
diff --git a/spec/models/deploy_keys_project_spec.rb b/spec/models/deploy_keys_project_spec.rb index 705ef257d86..0eb22599d18 100644 --- a/spec/models/deploy_keys_project_spec.rb +++ b/spec/models/deploy_keys_project_spec.rb @@ -44,9 +44,7 @@ describe DeployKeysProject do it "destroys the deploy key" do subject.destroy - expect { - deploy_key.reload - }.to raise_error(ActiveRecord::RecordNotFound) + expect { deploy_key.reload }.to raise_error(ActiveRecord::RecordNotFound) end end end diff --git a/spec/models/hooks/service_hook_spec.rb b/spec/models/hooks/service_hook_spec.rb index f7da4f43680..98cc0ede42e 100644 --- a/spec/models/hooks/service_hook_spec.rb +++ b/spec/models/hooks/service_hook_spec.rb @@ -50,9 +50,7 @@ describe ServiceHook do it "catches exceptions" do expect(WebHook).to receive(:post).and_raise("Some HTTP Post error") - expect { - @service_hook.execute(@data) - }.to raise_error + expect { @service_hook.execute(@data) }.to raise_error end end end diff --git a/spec/models/hooks/web_hook_spec.rb b/spec/models/hooks/web_hook_spec.rb index 70151ba2331..c74432d9739 100644 --- a/spec/models/hooks/web_hook_spec.rb +++ b/spec/models/hooks/web_hook_spec.rb @@ -71,9 +71,7 @@ describe ProjectHook do it "catches exceptions" do expect(WebHook).to receive(:post).and_raise("Some HTTP Post error") - expect { - @project_hook.execute(@data, 'push_hooks') - }.to raise_error + expect { @project_hook.execute(@data, 'push_hooks') }.to raise_error end end end diff --git a/spec/models/project_services/slack_service/issue_message_spec.rb b/spec/models/project_services/slack_service/issue_message_spec.rb index 8bca1fef44c..b78d92f23a1 100644 --- a/spec/models/project_services/slack_service/issue_message_spec.rb +++ b/spec/models/project_services/slack_service/issue_message_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe SlackService::IssueMessage do subject { SlackService::IssueMessage.new(args) } - let(:args) { + let(:args) do { user: { name: 'Test User', @@ -23,7 +23,7 @@ describe SlackService::IssueMessage do description: 'issue description' } } - } + end let(:color) { '#345' } diff --git a/spec/models/project_services/slack_service/merge_message_spec.rb b/spec/models/project_services/slack_service/merge_message_spec.rb index aeb408aa766..581c50d6c88 100644 --- a/spec/models/project_services/slack_service/merge_message_spec.rb +++ b/spec/models/project_services/slack_service/merge_message_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe SlackService::MergeMessage do subject { SlackService::MergeMessage.new(args) } - let(:args) { + let(:args) do { user: { name: 'Test User', @@ -24,7 +24,7 @@ describe SlackService::MergeMessage do target_branch: 'target_branch', } } - } + end let(:color) { '#345' } diff --git a/spec/models/project_services/slack_service/push_message_spec.rb b/spec/models/project_services/slack_service/push_message_spec.rb index 10963481a12..ddc290820d1 100644 --- a/spec/models/project_services/slack_service/push_message_spec.rb +++ b/spec/models/project_services/slack_service/push_message_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe SlackService::PushMessage do subject { SlackService::PushMessage.new(args) } - let(:args) { + let(:args) do { after: 'after', before: 'before', @@ -12,7 +12,7 @@ describe SlackService::PushMessage do user_name: 'user_name', project_url: 'url' } - } + end let(:color) { '#345' } @@ -40,16 +40,16 @@ describe SlackService::PushMessage do end context 'tag push' do - let(:args) { + let(:args) do { - after: 'after', - before: Gitlab::Git::BLANK_SHA, - project_name: 'project_name', - ref: 'refs/tags/new_tag', - user_name: 'user_name', - project_url: 'url' + after: 'after', + before: Gitlab::Git::BLANK_SHA, + project_name: 'project_name', + ref: 'refs/tags/new_tag', + user_name: 'user_name', + project_url: 'url' } - } + end it 'returns a message regarding pushes' do expect(subject.pretext).to eq('user_name pushed new tag ' \ diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb index 40335990025..869ace885f0 100644 --- a/spec/models/service_spec.rb +++ b/spec/models/service_spec.rb @@ -68,9 +68,16 @@ describe Service do describe "Template" do describe "for pushover service" do - let(:service_template) { - PushoverService.create(template: true, properties: { device: 'MyDevice', sound: 'mic', priority: 4, api_key: '123456789' }) - } + let(:service_template) do + PushoverService.create( + template: true, + properties: { + device: 'MyDevice', + sound: 'mic', + priority: 4, + api_key: '123456789' + }) + end let(:project) { create(:project) } describe 'should be prefilled for projects pushover service' do |