Retrospring/spec/features/users/sign_out_spec.rb

19 lines
606 B
Ruby
Raw Normal View History

2014-12-07 03:42:03 -08:00
# Feature: Sign out
# As a user
# I want to sign out
# So I can protect my account from unauthorized access
feature 'Sign out', :devise do
# Scenario: User signs out successfully
# Given I am signed in
# When I sign out
# Then I see a signed out message
scenario 'user signs out successfully', js: true do
user = FactoryGirl.create(:user)
signin(user.email, user.password)
expect(page).to have_content I18n.t 'devise.sessions.signed_in'
click_link user.screen_name
click_link 'Logout'
expect(page).to have_content I18n.t 'devise.sessions.signed_out'
end
end