Velocipede's User, Sales, and Bike Inventory Web App
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

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