Skip to content

Commit 1785c13

Browse files
committed
bunch of rubocop fixes
1 parent 7d26573 commit 1785c13

File tree

17 files changed

+27
-28
lines changed

17 files changed

+27
-28
lines changed

app/admin/admin_users.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
controller do
1919
def update
2020
admin_user_params = params[:admin_user]
21-
admin_user_params.delete_if {|param_name,_v| param_name.to_sym == :password } if admin_user_params.fetch(:password).blank?
21+
admin_user_params.delete_if { |param_name,_v| param_name.to_sym == :password } if admin_user_params.fetch(:password).blank?
2222
update!
2323
end
2424
end

app/controllers/ups_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ def show
55
ok = {status: :ok}
66
respond_with ok
77
end
8-
end
8+
end

app/services/event_tracker.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def identify
2626
end
2727

2828
private
29+
2930
def segment
3031
@segment ||= Segment::Analytics.new({
3132
write_key: ENV['SEGMENT_WRITE_KEY']

lib/ext/inet_input.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
class InetInput < Formtastic::Inputs::StringInput
2-
end
2+
end

lib/tasks/adhoc.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# - make it idempotent. I.e. running it twice should create twice the trouble.
44

55
namespace :adhoc do
6-
end
6+
end

lib/tasks/cron.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ namespace :cron do
66
task :daily
77
task :weekly
88
task :monthly
9-
end
9+
end

spec/controllers/payments_controller_spec.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
subject { get :new }
99

1010
context 'when there is a selected plan' do
11-
subject { get :new, params: {plan: 'nice_tip'} }
11+
subject { get :new, params: { plan: 'nice_tip' } }
1212
it 'should be success' do
1313
expect(subject).to be_successful
1414
end
@@ -24,7 +24,7 @@
2424
before { sign_out user }
2525

2626
it 'should be success' do
27-
expect(subject).to_not be_successful
27+
expect(subject).to_not be_successful
2828
end
2929
end
3030
end
@@ -35,8 +35,7 @@
3535
subject { post :create, params: params }
3636
before { stripe_helper.create_plan(id: 'good_tip') }
3737
let(:stripe_helper) { StripeMock.create_test_helper }
38-
let(:default_params) { {stripeToken: stripe_helper.generate_card_token, plan: 'good_tip'} }
39-
38+
let(:default_params) { { stripeToken: stripe_helper.generate_card_token, plan: 'good_tip' } }
4039

4140
context 'when there is a valid stripe token and plan' do
4241
let(:params) { default_params }
@@ -45,7 +44,7 @@
4544
expect { subject }.to change { RemoteKey.count }.by(1)
4645
expect(user.reload.stripe_customer).not_to be_nil
4746
expect(subject).to redirect_to page_path('thanks')
48-
expect(user.stripe_customer.retrieve.subscriptions.data.map{|s| s.plan[:id]}).to eq ['good_tip']
47+
expect(user.stripe_customer.retrieve.subscriptions.data.map { |s| s.plan[:id] }).to eq ['good_tip']
4948
end
5049
end
5150

spec/controllers/users_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
end
1414
end
1515
end
16-
end
16+
end

spec/factories.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
FactoryBot.define do
22
factory :admin_user do
33
sequence(:email) { |n| "admin-#{n}@example.com" }
4-
password { "foo12345" }
4+
password { 'foo12345' }
55
end
66

77
factory :super_admin do
88
sequence(:email) { |n| "super-admin-#{n}@example.com" }
9-
password { "foo12345" }
9+
password { 'foo12345' }
1010
end
1111

1212
factory :user do
1313
sequence(:email) { |n| "user-#{n}@example.com" }
14-
password { "foo12345" }
14+
password { 'foo12345' }
1515
end
1616
end

spec/features/admin_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
describe 'login' do
88
before do
99
sign_in admin
10-
visit "/admin"
10+
visit '/admin'
1111
end
1212
its(:current_path) { should == '/admin' }
1313

@@ -19,8 +19,8 @@
1919
end
2020

2121
it 'should not have an exception' do
22-
expect { subject }.not_to raise_error
22+
expect { subject }.not_to raise_error
2323
end
2424
end
2525
end
26-
end
26+
end

0 commit comments

Comments
 (0)