Thibault Jouan 688a178376 Validate uniqueness of user email address
* Make user.email attribute unique
* Render validations error messages in users/new view
2011-09-08 23:09:58 +00:00

13 lines
392 B
Ruby

Given /^a user with "([^"]*)" email address exists$/ do |email|
Factory.create(:user, :email => email)
end
When /^I register with "([^"]*)" email address$/ do |email|
visit new_user_path
user = Factory.build(:user)
fill_in('Email', :with => email)
fill_in('Password', :with => user.password)
fill_in('Password confirmation', :with => user.password)
click_button('Sign up')
end