Commit 80601044ca17435c4936e462a45b996eb15757f1
1 parent
aa6cc23b
Exists in
master
and in
1 other branch
Rubocop: remove leading and trailing space within parenthesis
Showing
8 changed files
with
13 additions
and
25 deletions
Show diff stats
.rubocop_todo.yml
@@ -354,18 +354,6 @@ Style/SpaceInsideBrackets: | @@ -354,18 +354,6 @@ Style/SpaceInsideBrackets: | ||
354 | Style/SpaceInsideHashLiteralBraces: | 354 | Style/SpaceInsideHashLiteralBraces: |
355 | Enabled: false | 355 | Enabled: false |
356 | 356 | ||
357 | -# Offense count: 23 | ||
358 | -# Cop supports --auto-correct. | ||
359 | -Style/SpaceInsideParens: | ||
360 | - Exclude: | ||
361 | - - 'spec/controllers/api/v1/problems_controller_spec.rb' | ||
362 | - - 'spec/controllers/comments_controller_spec.rb' | ||
363 | - - 'spec/controllers/problems_controller_spec.rb' | ||
364 | - - 'spec/interactors/problem_merge_spec.rb' | ||
365 | - - 'spec/mailers/mailer_spec.rb' | ||
366 | - - 'spec/models/notice_observer_spec.rb' | ||
367 | - - 'spec/models/notice_spec.rb' | ||
368 | - | ||
369 | # Offense count: 9 | 357 | # Offense count: 9 |
370 | # Cop supports --auto-correct. | 358 | # Cop supports --auto-correct. |
371 | # Configuration parameters: EnforcedStyle, SupportedStyles. | 359 | # Configuration parameters: EnforcedStyle, SupportedStyles. |
spec/controllers/api/v1/problems_controller_spec.rb
@@ -37,7 +37,7 @@ describe Api::V1::ProblemsController, type: 'controller' do | @@ -37,7 +37,7 @@ describe Api::V1::ProblemsController, type: 'controller' do | ||
37 | get :show, :auth_token => @user.authentication_token, :format => "json", :id => @problem.id | 37 | get :show, :auth_token => @user.authentication_token, :format => "json", :id => @problem.id |
38 | returned_problem = JSON.parse(response.body) | 38 | returned_problem = JSON.parse(response.body) |
39 | 39 | ||
40 | - expect( returned_problem.keys ).to match_array(%w( | 40 | + expect(returned_problem.keys).to match_array(%w( |
41 | app_name | 41 | app_name |
42 | first_notice_at | 42 | first_notice_at |
43 | message | 43 | message |
@@ -53,7 +53,7 @@ describe Api::V1::ProblemsController, type: 'controller' do | @@ -53,7 +53,7 @@ describe Api::V1::ProblemsController, type: 'controller' do | ||
53 | 53 | ||
54 | it "returns a 404 if the problem cannot be found" do | 54 | it "returns a 404 if the problem cannot be found" do |
55 | get :show, :auth_token => @user.authentication_token, :format => "json", :id => 'IdontExist' | 55 | get :show, :auth_token => @user.authentication_token, :format => "json", :id => 'IdontExist' |
56 | - expect( response.status ).to eq(404) | 56 | + expect(response.status).to eq(404) |
57 | end | 57 | end |
58 | end | 58 | end |
59 | 59 |
spec/controllers/comments_controller_spec.rb
@@ -24,7 +24,7 @@ describe CommentsController, type: 'controller' do | @@ -24,7 +24,7 @@ describe CommentsController, type: 'controller' do | ||
24 | end | 24 | end |
25 | 25 | ||
26 | it "should redirect to problem page" do | 26 | it "should redirect to problem page" do |
27 | - expect(response).to redirect_to( app_problem_path(problem.app, problem) ) | 27 | + expect(response).to redirect_to(app_problem_path(problem.app, problem)) |
28 | end | 28 | end |
29 | end | 29 | end |
30 | end | 30 | end |
@@ -50,7 +50,7 @@ describe CommentsController, type: 'controller' do | @@ -50,7 +50,7 @@ describe CommentsController, type: 'controller' do | ||
50 | end | 50 | end |
51 | 51 | ||
52 | it "should redirect to problem page" do | 52 | it "should redirect to problem page" do |
53 | - expect(response).to redirect_to( app_problem_path(problem.app, problem) ) | 53 | + expect(response).to redirect_to(app_problem_path(problem.app, problem)) |
54 | end | 54 | end |
55 | end | 55 | end |
56 | end | 56 | end |
spec/controllers/problems_controller_spec.rb
@@ -256,7 +256,7 @@ describe ProblemsController, type: 'controller' do | @@ -256,7 +256,7 @@ describe ProblemsController, type: 'controller' do | ||
256 | context "when app has no issue tracker" do | 256 | context "when app has no issue tracker" do |
257 | it "should redirect to problem page" do | 257 | it "should redirect to problem page" do |
258 | post :create_issue, app_id: problem.app.id, id: problem.id | 258 | post :create_issue, app_id: problem.app.id, id: problem.id |
259 | - expect(response).to redirect_to( app_problem_path(problem.app, problem) ) | 259 | + expect(response).to redirect_to(app_problem_path(problem.app, problem)) |
260 | expect(flash[:error]).to eql "This app has no issue tracker" | 260 | expect(flash[:error]).to eql "This app has no issue tracker" |
261 | end | 261 | end |
262 | end | 262 | end |
@@ -276,7 +276,7 @@ describe ProblemsController, type: 'controller' do | @@ -276,7 +276,7 @@ describe ProblemsController, type: 'controller' do | ||
276 | end | 276 | end |
277 | 277 | ||
278 | it "should redirect to problem page" do | 278 | it "should redirect to problem page" do |
279 | - expect(response).to redirect_to( app_problem_path(err.app, err.problem) ) | 279 | + expect(response).to redirect_to(app_problem_path(err.app, err.problem)) |
280 | end | 280 | end |
281 | 281 | ||
282 | it "should clear issue link" do | 282 | it "should clear issue link" do |
@@ -293,7 +293,7 @@ describe ProblemsController, type: 'controller' do | @@ -293,7 +293,7 @@ describe ProblemsController, type: 'controller' do | ||
293 | end | 293 | end |
294 | 294 | ||
295 | it "should redirect to problem page" do | 295 | it "should redirect to problem page" do |
296 | - expect(response).to redirect_to( app_problem_path(err.app, err.problem) ) | 296 | + expect(response).to redirect_to(app_problem_path(err.app, err.problem)) |
297 | end | 297 | end |
298 | end | 298 | end |
299 | end | 299 | end |
spec/interactors/problem_merge_spec.rb
@@ -52,8 +52,8 @@ describe ProblemMerge do | @@ -52,8 +52,8 @@ describe ProblemMerge do | ||
52 | end | 52 | end |
53 | 53 | ||
54 | context "with problem with comment" do | 54 | context "with problem with comment" do |
55 | - let!(:comment) { Fabricate(:comment, :err => problem ) } | ||
56 | - let!(:comment_2) { Fabricate(:comment, :err => problem_1, :user => comment.user ) } | 55 | + let!(:comment) { Fabricate(:comment, :err => problem) } |
56 | + let!(:comment_2) { Fabricate(:comment, :err => problem_1, :user => comment.user) } | ||
57 | it 'merge comment' do | 57 | it 'merge comment' do |
58 | expect { | 58 | expect { |
59 | problem_merge.merge | 59 | problem_merge.merge |
spec/mailers/mailer_spec.rb
@@ -81,13 +81,13 @@ describe Mailer do | @@ -81,13 +81,13 @@ describe Mailer do | ||
81 | end | 81 | end |
82 | 82 | ||
83 | it "should have the error count in the subject" do | 83 | it "should have the error count in the subject" do |
84 | - expect(email.subject).to match( /^\(3\) / ) | 84 | + expect(email.subject).to match(/^\(3\) /) |
85 | end | 85 | end |
86 | 86 | ||
87 | context 'with a very long message' do | 87 | context 'with a very long message' do |
88 | let(:notice) { Fabricate(:notice, :message => 6.times.collect{|_a| "0123456789" }.join('')) } | 88 | let(:notice) { Fabricate(:notice, :message => 6.times.collect{|_a| "0123456789" }.join('')) } |
89 | it "should truncate the long message" do | 89 | it "should truncate the long message" do |
90 | - expect(email.subject).to match( / \d{47}\.{3}$/ ) | 90 | + expect(email.subject).to match(/ \d{47}\.{3}$/) |
91 | end | 91 | end |
92 | end | 92 | end |
93 | end | 93 | end |
spec/models/notice_observer_spec.rb
@@ -130,7 +130,7 @@ describe "Callback on Notice", type: 'model' do | @@ -130,7 +130,7 @@ describe "Callback on Notice", type: 'model' do | ||
130 | describe 'should not send a notification if a notification service is not' \ | 130 | describe 'should not send a notification if a notification service is not' \ |
131 | 'configured' do | 131 | 'configured' do |
132 | let(:notification_service) { Fabricate(:notification_service) } | 132 | let(:notification_service) { Fabricate(:notification_service) } |
133 | - let(:app) { Fabricate(:app, notification_service: notification_service )} | 133 | + let(:app) { Fabricate(:app, notification_service: notification_service)} |
134 | let(:notice_attrs) { notice_attrs_for.call(app.api_key) } | 134 | let(:notice_attrs) { notice_attrs_for.call(app.api_key) } |
135 | 135 | ||
136 | before { Errbit::Config.per_app_notify_at_notices = true } | 136 | before { Errbit::Config.per_app_notify_at_notices = true } |
spec/models/notice_spec.rb
@@ -61,7 +61,7 @@ describe Notice, type: 'model' do | @@ -61,7 +61,7 @@ describe Notice, type: 'model' do | ||
61 | 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16' | 61 | 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16' |
62 | }}) | 62 | }}) |
63 | expect(notice.user_agent.browser).to eq 'Chrome' | 63 | expect(notice.user_agent.browser).to eq 'Chrome' |
64 | - expect(notice.user_agent.version.to_s).to match( /^10\.0/ ) | 64 | + expect(notice.user_agent.version.to_s).to match(/^10\.0/) |
65 | end | 65 | end |
66 | 66 | ||
67 | it "should be nil if HTTP_USER_AGENT is blank" do | 67 | it "should be nil if HTTP_USER_AGENT is blank" do |