
Untitled
By: a guest on
Aug 12th, 2012 | syntax:
None | size: 0.95 KB | hits: 11 | expires: Never
require 'spec_helper'
describe "Sign in process" do
before(:each) do
@user = User.create!(:email => 'user@example.com', :password => 'somepass', :password_confirmation => 'somepass')
end
it "confirmed user should sign in with correct credentials" do
@user.confirm!
visit new_user_session_path
within("#user_new") do
fill_in 'Email', :with => 'user@example.com'
fill_in 'Пароль', :with => 'somepass'
end
click_button 'Войти'
page.should have_content 'Выйти'
page.should_not have_content 'Войти'
end
it "unconfirmed user should not sign in with correct credentials" do
visit new_user_session_path
within("#user_new") do
fill_in 'Email', :with => 'user@example.com'
fill_in 'Пароль', :with => 'somepass'
end
click_button 'Войти'
page.should have_content 'Войти'
page.should_not have_content 'Выйти'
end
end