Sha256: 12393c2ade79a8eaa1d49e266b7f1bf0a19b8a84abe433e70833a204c46ceddb
Contents?: true
Size: 1.07 KB
Versions: 6
Compression:
Stored size: 1.07 KB
Contents
require "rails_helper" # Automatically generated by the orthodox gem (https://github.com/katanacode/orthodox) # (c) Copyright 2019 Katana Code Ltd. All Rights Reserved. RSpec.describe "<%= plural_class_name %>::Authentication", type: :system do let!(:<%= singular_name %>) { create(:<%= singular_name %>) } scenario "A <%= singular_name %> signs in successfully" do visit new_<%= plural_name %>_session_path fill_in :<%= singular_name %>_session_email, with: <%= singular_name %>.email fill_in :<%= singular_name %>_session_password, with: <%= singular_name %>.password click_button "Sign in" expect(current_path).to eql(<%= plural_name %>_dashboard_path) end scenario "A <%= singular_name %> attempts to sign in unsuccessfully" do visit new_<%= plural_name %>_session_path fill_in :<%= singular_name %>_session_email, with: <%= singular_name %>.email fill_in :<%= singular_name %>_session_password, with: "WRONG-PASSWORD" click_button "Sign in" expect(page).to have_text(<%= class_name%>Session::INVALID_CREDENTIALS) end end
Version data entries
6 entries across 6 versions & 1 rubygems