9fd38cae5e
System specs have been available since Rails 5.1, and are better integrated with the Rails framework. - Rename `spec/features` to `spec/system` - Rename `feature do` to `describe do` - Configure Capybara for system specs Steps mostly taken from https://medium.com/table-xi/a-quick-guide-to-rails-system-tests-in-rspec-b6e9e8a8b5f6
15 lines
320 B
Ruby
15 lines
320 B
Ruby
describe 'Sign out' do
|
|
context 'when a user is logged in' do
|
|
let(:user) { create(:administrateur).user }
|
|
|
|
before { login_as user, scope: :user }
|
|
|
|
scenario 'he can sign out' do
|
|
visit dossiers_path
|
|
|
|
click_on 'Se déconnecter'
|
|
|
|
expect(page).to have_current_path(root_path)
|
|
end
|
|
end
|
|
end
|