Browse Source

CLDC-752 - Sign in link added

pull/113/head
Matthew Phelan 4 years ago
parent
commit
81c8bb8494
  1. 7
      app/views/layouts/application.html.erb
  2. 10
      spec/features/user_spec.rb

7
app/views/layouts/application.html.erb

@ -39,10 +39,11 @@
service_name: 'Share Lettings and Sales for Social Housing in England Data with DLUHC',
service_url: '/'
) do |component|
unless current_user.nil?
if current_user.nil?
component.navigation_item(text: 'Case logs', href: '/case_logs')
elsif
component.navigation_item(text: 'Your account', href: '/users/account')
component.navigation_item(text: 'Sign out', href: destroy_user_session_path)
component.navigation_item(text: 'Page C', href: '/#page-c')
component.navigation_item(text: 'Sign out', href: destroy_user_session_path, options: {:method => :delete})
end
end
%>

10
spec/features/user_spec.rb

@ -64,6 +64,16 @@ RSpec.describe "User Features" do
expect(page).to have_no_link("Your account")
end
it "Can navigate and sign in page with sign in button" do
visit("/")
expect(page).to have_link("Case logs")
click_link("Case logs")
fill_in("user_email", with: user.email)
fill_in("user_password", with: "pAssword1")
click_button("Sign in")
expect(page).to have_current_path("/case_logs")
end
it "tries to access account page, redirects to log in page" do
visit("/users/account")
expect(page).to have_content("Sign in to your account to submit CORE data")

Loading…
Cancel
Save