Skip to content

Commit 821015d

Browse files
committed
Fix redirect after signing in
For now I'm making it redirect to the first tab on the Admin dashboard but we may want to change that later.
1 parent 76471f6 commit 821015d

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

app/controllers/concerns/authentication.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def request_authentication
3535
end
3636

3737
def after_authentication_url
38-
session.delete(:return_to_after_authenticating) || root_url
38+
session.delete(:return_to_after_authenticating) || regions_url
3939
end
4040

4141
def start_new_session_for(user)

spec/system/login_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
require "rails_helper"
22

33
RSpec.describe "User Login", type: :system do
4+
# will probably need to be amended once we have a page for non-Admin users
45
let!(:user) { create(:user) }
56

6-
# context "with correct email and password" do
7-
# it "logs in the user" do
8-
# visit new_session_path
9-
# fill_in "email", with: user.email
10-
# fill_in "password", with: user.password
11-
# click_button("Sign in")
7+
context "with correct email and password" do
8+
it "logs in the user" do
9+
visit new_session_path
10+
fill_in "email", with: user.email
11+
fill_in "password", with: user.password
12+
click_button("Sign in")
1213

13-
# # will probably need to be amended once we have a page for non-Admin users
14-
# expect(page).to have_text("Administration")
15-
# end
16-
# end
14+
expect(page).to have_text("Regions Served")
15+
end
16+
end
1717

1818
context "with incorrect email or password" do
1919
it "shows error message" do

0 commit comments

Comments
 (0)