Signed in users are now redirected to main page if they try to access root (#1726)

This commit is contained in:
Ahmad Farhat
2020-06-02 16:42:15 -04:00
committed by GitHub
parent 9cf7e53c99
commit 737d39dce9
4 changed files with 19 additions and 7 deletions

View File

@ -24,5 +24,14 @@ describe MainController, type: :controller do
get :index
expect(response).to be_successful
end
it "redirects signed in user to their home page" do
user = create(:user)
@request.session[:user_id] = user.id
get :index
expect(response).to redirect_to(user.main_room)
end
end
end