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 | 354 | Style/SpaceInsideHashLiteralBraces: |
355 | 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 | 357 | # Offense count: 9 |
370 | 358 | # Cop supports --auto-correct. |
371 | 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 | 37 | get :show, :auth_token => @user.authentication_token, :format => "json", :id => @problem.id |
38 | 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 | 41 | app_name |
42 | 42 | first_notice_at |
43 | 43 | message |
... | ... | @@ -53,7 +53,7 @@ describe Api::V1::ProblemsController, type: 'controller' do |
53 | 53 | |
54 | 54 | it "returns a 404 if the problem cannot be found" do |
55 | 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 | 57 | end |
58 | 58 | end |
59 | 59 | ... | ... |
spec/controllers/comments_controller_spec.rb
... | ... | @@ -24,7 +24,7 @@ describe CommentsController, type: 'controller' do |
24 | 24 | end |
25 | 25 | |
26 | 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 | 28 | end |
29 | 29 | end |
30 | 30 | end |
... | ... | @@ -50,7 +50,7 @@ describe CommentsController, type: 'controller' do |
50 | 50 | end |
51 | 51 | |
52 | 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 | 54 | end |
55 | 55 | end |
56 | 56 | end | ... | ... |
spec/controllers/problems_controller_spec.rb
... | ... | @@ -256,7 +256,7 @@ describe ProblemsController, type: 'controller' do |
256 | 256 | context "when app has no issue tracker" do |
257 | 257 | it "should redirect to problem page" do |
258 | 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 | 260 | expect(flash[:error]).to eql "This app has no issue tracker" |
261 | 261 | end |
262 | 262 | end |
... | ... | @@ -276,7 +276,7 @@ describe ProblemsController, type: 'controller' do |
276 | 276 | end |
277 | 277 | |
278 | 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 | 280 | end |
281 | 281 | |
282 | 282 | it "should clear issue link" do |
... | ... | @@ -293,7 +293,7 @@ describe ProblemsController, type: 'controller' do |
293 | 293 | end |
294 | 294 | |
295 | 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 | 297 | end |
298 | 298 | end |
299 | 299 | end | ... | ... |
spec/interactors/problem_merge_spec.rb
... | ... | @@ -52,8 +52,8 @@ describe ProblemMerge do |
52 | 52 | end |
53 | 53 | |
54 | 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 | 57 | it 'merge comment' do |
58 | 58 | expect { |
59 | 59 | problem_merge.merge | ... | ... |
spec/mailers/mailer_spec.rb
... | ... | @@ -81,13 +81,13 @@ describe Mailer do |
81 | 81 | end |
82 | 82 | |
83 | 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 | 85 | end |
86 | 86 | |
87 | 87 | context 'with a very long message' do |
88 | 88 | let(:notice) { Fabricate(:notice, :message => 6.times.collect{|_a| "0123456789" }.join('')) } |
89 | 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 | 91 | end |
92 | 92 | end |
93 | 93 | end | ... | ... |
spec/models/notice_observer_spec.rb
... | ... | @@ -130,7 +130,7 @@ describe "Callback on Notice", type: 'model' do |
130 | 130 | describe 'should not send a notification if a notification service is not' \ |
131 | 131 | 'configured' do |
132 | 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 | 134 | let(:notice_attrs) { notice_attrs_for.call(app.api_key) } |
135 | 135 | |
136 | 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 | 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 | 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 | 65 | end |
66 | 66 | |
67 | 67 | it "should be nil if HTTP_USER_AGENT is blank" do | ... | ... |