Guest User

Untitled

a guest
Aug 18th, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. require File.dirname(__FILE__) + '/acceptance_helper'
  2.  
  3. feature "Create User", %q{
  4. In order to use all Uno applications
  5. As someone that is not yet an user
  6. I want to create my account
  7. } do
  8.  
  9. before :all do
  10. @mail = 'test@testing.com' and @pass = 'my pass'
  11. @user = User.make!(:email => @mail)
  12. end
  13.  
  14. scenario "Successfully creating an account" do
  15. visit '/users/new'
  16. fill_in 'user_email', :with => @mail
  17. fill_in 'user_password', :with => @pass
  18. fill_in 'user_password_confirmation', :with => @pass
  19.  
  20. User.should_receive(:new).with({'email' => @mail, 'password' => @pass, 'password_confirmation' => @pass}).and_return(@user)
  21.  
  22. User.should_receive(:find).with(@user.id.to_s).and_return(@user)
  23.  
  24. click_button 'Save'
  25.  
  26. page.current_path.should == "/users/#{@user.id}"
  27. page.should have_content @mail
  28. end
  29.  
  30. end
Add Comment
Please, Sign In to add comment