Created
January 29, 2011 14:58
-
-
Save cayblood/801891 to your computer and use it in GitHub Desktop.
This file contains 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
it "should create a user if an unused email is provided" do | |
VCR.use_cassette('create_user_with_email', :record => :new_episodes) do | |
options = {:email => '[email protected]'} | |
UUIDTools::UUID.stub!(:random_create).and_return('7c4037cc-e021-48c0-990a-51b3e82d48d6') | |
response = @api.create_user(options) | |
response.should be_a(Hash) | |
response['guid'] | |
end | |
end | |
it 'should raise an exception if the supplied email address is already in use' do | |
VCR.use_cassette('duplicate_email', :record => :new_episodes) do | |
options = {:email => '[email protected]'} | |
lambda { @api.create_user(options) }.should raise_exception(RuntimeError, "Unable to create user: email has already been taken") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment