Skip to content

Commit 564ac2f

Browse files
committed
fix rubocop
1 parent fe7e013 commit 564ac2f

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

app/controllers/users_controller.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ class UsersController < ApplicationController
33

44
def index
55
@users = User.all
6-
#users = User.all
7-
86
end
97

108
def create
@@ -49,6 +47,6 @@ def set_user
4947
end
5048

5149
def user_params
52-
params.expect(user: [:email, :password, :is_admin])
50+
params.expect(user: [ :email, :password, :is_admin ])
5351
end
5452
end

app/models/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ class User < ApplicationRecord
44

55
normalizes :email, with: ->(e) { e.strip.downcase }
66

7-
validates :email, presence: true, uniqueness: true,format: URI::MailTo::EMAIL_REGEXP
7+
validates :email, presence: true, uniqueness: true, format: URI::MailTo::EMAIL_REGEXP
88
validates :password_digest, presence: true
99
end

config/routes.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
resources :regions
33
root "home#index"
44
get "home/index", as: :home
5-
resource :session, except:[:new]
6-
resources :passwords, except: [:new], param: :token
5+
resource :session, except: [ :new ]
6+
resources :passwords, except: [ :new ], param: :token
77
resource :registration, only: %i[new create]
88
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
99
get "connexion", to: "sessions#new"
10-
get 'reset_password', to:"passwords#new"
10+
get "reset_password", to: "passwords#new"
1111
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
1212
# Can be used by load balancers and uptime monitors to verify that the app is live.
1313
get "up" => "rails/health#show", as: :rails_health_check

spec/factories/users.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FactoryBot.define do
22
factory :user do
3-
email { Faker::Internet.email}
3+
email { Faker::Internet.email }
44
password { "password" }
55
end
66
end

spec/requests/users_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# This should return the minimal set of attributes required to create a valid
2525
# User. As you add validations to User, be sure to
2626
# adjust the attributes here as well.
27-
let(:valid_attributes) { { email: "[email protected]" , password:"123"} }
27+
let(:valid_attributes) { { email: "[email protected]", password: "123" } }
2828

2929
let(:invalid_attributes) { { email: "" } }
3030

0 commit comments

Comments
 (0)