1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-02-28 16:53:23 -05:00

Update spec tests for registration page

This commit is contained in:
Jason Denney 2014-03-12 21:29:01 -04:00
parent 1f9322ff3d
commit 124ce5901d

View File

@ -1,10 +1,11 @@
require 'spec_helper' require 'spec_helper'
describe "New User Registrations" do describe "New User Registrations" do
it 'should have a link to sign up on the homepage' do it 'should have a link to sign up on the homepage' do
visit root_path visit root_path
page.should have_link 'Register' page.should have_link 'Sign up'
click_link 'Register' click_link 'Sign up'
current_path.should == new_user_registration_path current_path.should == new_user_registration_path
end end
@ -13,30 +14,29 @@ describe "New User Registrations" do
visit new_user_registration_path visit new_user_registration_path
end end
it 'should have the additional user fields on the registration page' do it 'should have the additional user fields on the registration page' do
page.should have_field 'First name' page.should have_field 'user_first_name'
page.should have_field 'Last name' page.should have_field 'user_last_name'
page.should have_field 'Nickname' page.should have_field 'user_email'
page.should have_field 'Email' page.should have_field 'user_password'
page.should have_field 'Password' page.should have_field 'user_password_confirmation'
page.should have_field 'Password confirmation'
page.should have_button 'Sign up' page.should have_button 'Sign up'
end end
context 'required non-devise fields' do context 'required non-devise fields' do
before do before do
fill_in 'Email', :with => 'FF@example.com' fill_in 'user_email', :with => 'FF@example.com'
fill_in 'Password', :with => 'password' fill_in 'user_password', :with => 'password'
fill_in 'Password confirmation', :with => 'password' fill_in 'user_password_confirmation', :with => 'password'
end end
it 'should require first name' do it 'should require first name' do
fill_in 'Last name', :with => 'Footer' fill_in 'user_last_name', :with => 'Footer'
click_button 'Sign up' click_button 'Sign up'
page.should have_content "First name can't be blank" page.should have_content "First name can't be blank"
end end
it 'should require last name' do it 'should require last name' do
fill_in 'First name', :with => 'Frank' fill_in 'user_first_name', :with => 'Frank'
click_button 'Sign up' click_button 'Sign up'
page.should have_content "Last name can't be blank" page.should have_content "Last name can't be blank"
end end