Guest User

Untitled

a guest
Jul 21st, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. it "should create a user if an unused email is provided" do
  2. VCR.use_cassette('create_user_with_email', :record => :new_episodes) do
  3. options = {:email => 'carl@youngbloods.org'}
  4. UUIDTools::UUID.stub!(:random_create).and_return('7c4037cc-e021-48c0-990a-51b3e82d48d6')
  5. response = @api.create_user(options)
  6. response.should be_a(Hash)
  7. response['guid']
  8. end
  9. end
  10.  
  11. it 'should raise an exception if the supplied email address is already in use' do
  12. VCR.use_cassette('duplicate_email', :record => :new_episodes) do
  13. options = {:email => 'carl@youngbloods.org'}
  14. lambda { @api.create_user(options) }.should raise_exception(RuntimeError, "Unable to create user: email has already been taken")
  15. end
  16. end
Add Comment
Please, Sign In to add comment