Skip to content

Instantly share code, notes, and snippets.

@lucasrenan
Created December 16, 2014 20:29
Show Gist options
  • Save lucasrenan/f44390137f59c7851805 to your computer and use it in GitHub Desktop.
Save lucasrenan/f44390137f59c7851805 to your computer and use it in GitHub Desktop.
require 'rails_helper'
feature 'authentication' do
let!(:user) { create(:user, password: '12345678', password_confirmation: '12345678') }
before do
visit root_path
fill_in :user_email, with: user.email
fill_in :user_password, with: '12345678'
click_button 'Sign in'
end
describe 'logging' do
it 'logs in with valid credentials' do
expect(page).to have_content('logout')
end
end
describe 'logging out' do
it 'logs out' do
click_link 'logout'
expect(page).not_to have_content('logout')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment