Commit 102b823b
Changed files (5)
app
controllers
spec
features
app/controllers/registrations_controller.rb
@@ -3,7 +3,7 @@ class RegistrationsController < ApplicationController
user = User.create(secure_params)
if user.save
cookies.signed[:raphael] = User.login(secure_params[:email], secure_params[:password]).access(request)
- redirect_to my_root_path
+ redirect_to my_dashboard_path
else
flash[:error] = user.errors.full_messages
redirect_to new_session_path
app/controllers/sessions_controller.rb
@@ -1,13 +1,13 @@
class SessionsController < ApplicationController
def new
- redirect_to my_root_path if user_signed_in?
+ redirect_to my_dashboard_path if user_signed_in?
@session = UserSession.new
end
def create
if @session = User.login(session_params[:username], session_params[:password])
cookies.signed[:raphael] = @session.access(request)
- redirect_to my_root_path
+ redirect_to my_dashboard_path
else
flash[:error] = "Ooops... invalid email or password."
redirect_to login_path
spec/controllers/registrations_controller_spec.rb
@@ -10,7 +10,7 @@ describe RegistrationsController do
post :create, user: { name: 'mo', email: 'mo@cakeside.com', password: 'password' }
expect(User.count).to eql(1)
- expect(response).to redirect_to(my_root_path)
+ expect(response).to redirect_to(my_dashboard_path)
expect(cookies.signed[:raphael]).to_not be_nil
expect(cookies.signed[:raphael]).to eql(user_session.access)
end
spec/controllers/sessions_controller_spec.rb
@@ -17,7 +17,7 @@ describe SessionsController do
it "redirects to the dashboard" do
get :new
- expect(response).to redirect_to(my_root_path)
+ expect(response).to redirect_to(my_dashboard_path)
end
end
end
@@ -39,7 +39,7 @@ describe SessionsController do
end
it "redirects to the dashboard" do
- expect(response).to redirect_to(my_root_path)
+ expect(response).to redirect_to(my_dashboard_path)
end
end
spec/features/change_password_spec.rb
@@ -11,7 +11,7 @@ describe "changing my password", js: true do
fill_in('session_password', :with => "password")
end
click_button("Sign In")
- visit my_root_path
+ visit my_dashboard_path
click_link("Account")
within(".form-horizontal") do
fill_in('user_password', :with => "mopass")