Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe 'A new user', js: true do
- before do
- @new_user = Fabricate.build(:user)
- end
- it 'should sign up' do
- #login code
- visit '/'
- click_link 'Login'
- fill_in 'user[email]', :with => @new_user.email
- fill_in 'user[password]', :with => @new_user.password
- click_button 'Login now'
- #login code end
- page.should have_content("Hello #{@new_user.first_name}!")
- current_path.should == dashboard_path
- end
- it 'should receive a confirmation mail' do
- #same login code again
- visit '/'
- click_link 'Login'
- fill_in 'user[email]', :with => @new_user.email
- fill_in 'user[password]', :with => @new_user.password
- click_button 'Login now'
- mail = ActionMailer::Base.deliveries.last
- assert_equal @new_user.email, mail['to'].to_s
- end
- end
- it 'should do something after login' do
- do_login
- #test code here
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement