Sha256: bf96a742abe2ce65199281471c8c217df8919274d6d59252605df48a465850de
Contents?: true
Size: 1.14 KB
Versions: 2
Compression:
Stored size: 1.14 KB
Contents
require 'spec_helper' describe 'User Create' do def create_user(attributes = {}) attributes = { :email => "steve@apple.com", :first_name => "Steve", :last_name => "Jobs", :primary_role_id => 1, :password => "password", :password_confirmation => "password" }.merge(attributes) board.users.create(attributes) end context 'when no user with the email exists' do use_vcr_cassette "user does not exist" it 'creates the user' do user = create_user user.email.should == "steve@apple.com" user.first_name.should == "Steve" user.last_name.should == "Jobs" end end context 'when a user with the email exists' do use_vcr_cassette "user does exist" it 'raises an error' do begin create_user rescue Board::Client::Error => e end e.response.body.should =~ /is already taken/ end end context 'when missing required attributes' do use_vcr_cassette "user missing attributes" it 'raises an error' do expect { create_user(:email => nil) }.to raise_error end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
board-client-0.99.1 | spec/integration/users/create_spec.rb |
board-client-0.99.0 | spec/integration/users/create_spec.rb |