File tree Expand file tree Collapse file tree 8 files changed +30
-74
lines changed
Expand file tree Collapse file tree 8 files changed +30
-74
lines changed Original file line number Diff line number Diff 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 )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4646
4747 < li class ="sidebar-item ">
4848 <%= link_to regions_path , class : "sidebar-link" do %>
49- < i class ="bi bi-hospital-fill "> </ i >
49+ < i class ="bi bi-globe "> </ i >
5050 < span > Regions</ span >
5151 <% end %>
5252 </ li >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- < h1 > User list </ h1 >
2-
31< div class ="page-heading ">
42 < section class ="section ">
53 < div class ="card ">
6- < div class ="card-body ">
7- <%= link_to new_region_path , class : "btn btn-primary m-2" do %>
4+ < div class ="card-header d-flex justify-content-between align-items-center ">
5+ < h2 > User List</ h2 >
6+ <%= link_to new_user_path , class : "btn btn-primary m-2" do %>
87 < i class ="bi bi-plus "> </ i > Add New User
98 <% end %>
9+ </ div >
10+ < div class ="card-body ">
1011 < table class ="table table-striped " id ="table1 ">
1112 < thead >
1213 < tr >
Original file line number Diff line number Diff line change 1515 get users_url
1616 expect ( response ) . to be_successful
1717 end
18+
19+ it "has a link to add a new user" do
20+ get users_url
21+ expect ( page ) . to have_link ( "Add New User" , href : new_user_path )
22+ end
1823 end
1924
2025 describe "GET /new" do
Original file line number Diff line number Diff line change 66 Capybara ::Selenium ::Driver . new ( app , browser : :chrome )
77end
88
9+ module CapybaraPage
10+ def page
11+ Capybara . string ( response . body )
12+ end
13+ end
14+
915RSpec . configure do |config |
1016 config . before ( :each , type : :system ) do
1117 driven_by :rack_test
1420 config . before ( :each , :debug , type : :system ) do
1521 driven_by :selenium_chrome
1622 end
23+
24+ config . include CapybaraPage , type : :request
1725end
Original file line number Diff line number Diff line change 11require "rails_helper"
22
33RSpec . 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
You can’t perform that action at this time.
0 commit comments