Created
October 26, 2013 07:21
-
-
Save aag1091/7166309 to your computer and use it in GitHub Desktop.
A simple feature spec
This file contains hidden or 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' | |
feature 'Visitor signs up', :js => true do | |
scenario 'with valid details' do | |
visit root_path | |
find('#connect_id').hover | |
within('#connect_area') do | |
find('.share_mail').click | |
end | |
within('.sign_up') do | |
fill_in 'user_full_name', with: 'Bob Martin' | |
fill_in 'user_email', with: '[email protected]' | |
fill_in 'user_password', with: '12345678' | |
fill_in 'user_password_confirmation', with: '12345678' | |
click_button('REGISTER') | |
end | |
sleep 4 | |
expect(User.last.email).to eq("[email protected]") | |
end | |
scenario 'with invalid email details' do | |
visit root_path | |
find('#connect_id').hover | |
within('#connect_area') do | |
find('.share_mail').click | |
end | |
within('.sign_up') do | |
fill_in 'user_full_name', with: 'Bob Martin' | |
fill_in 'user_email', with: 'bob.martin' | |
fill_in 'user_password', with: '12345678' | |
fill_in 'user_password_confirmation', with: '12345678' | |
click_button('REGISTER') | |
end | |
expect(User.last.try(:email)).to_not eq('bob.martin') | |
end | |
scenario 'with invalid password details' do | |
visit root_path | |
find('#connect_id').hover | |
within('#connect_area') do | |
find('.share_mail').click | |
end | |
within('.sign_up') do | |
fill_in 'user_full_name', with: 'Bob Martin' | |
fill_in 'user_email', with: '[email protected]' | |
fill_in 'user_password', with: '1234' | |
fill_in 'user_password_confirmation', with: '12345678' | |
click_button('REGISTER') | |
end | |
expect(User.last.try(:email)).to_not eq('[email protected]') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment