Created
October 11, 2013 01:02
-
-
Save alexclarkofficial/6928105 to your computer and use it in GitHub Desktop.
test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "Authentication" do | |
subject { page } | |
describe "signin" do | |
before { visit root_path } | |
it { should have_button('Sign in') } | |
describe "with invalid information" do | |
before { click_button "Sign in" } | |
it { should have_selector('div.alert.alert-error', text: 'Please enter a valid username or email') } | |
end | |
describe "with valid username" do | |
let(:user) { FactoryGirl.create(:user) } | |
before do | |
fill_in "Username or email", with: user.name | |
fill_in "Password", with: user.password | |
click_button "Sign in" | |
end | |
it { should redirect_to @user } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment