demarches-normaliennes/spec/system/users/sign_out_spec.rb
Pierre de La Morinerie 9fd38cae5e specs: migrate from features to system specs
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
2021-10-26 12:24:46 +02:00

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