Sha256: 6dc8031860b06143a7bb4cdfafdbaa835b62ae5ae41289c4cad533b0515f8c8e
Contents?: true
Size: 1.82 KB
Versions: 3
Compression:
Stored size: 1.82 KB
Contents
require File.join(File.dirname(__FILE__), "/../spec_helper" ) module Rumblr describe User, 'initializing' do it 'should have the attributes of a User' do User.new.should respond_to( :email, :password, :can_upload_video, :can_upload_aiff, :vimeo_login_url, :can_upload_audio ) end it 'tumblelogs should initialize empty' do User.new.tumblelogs.should be_a_kind_of(Array) end end describe User, 'logging in' do before(:each) do mock_successful(:authenticate) end it 'should login with email and password' do user = User.login(:email => 'valid_email', :password => 'valid_password') user.should be_an_instance_of(User) end it 'should not initialize without email' do lambda do User.login(:email => nil, :password => 'valid_password') end.should raise_error(ArgumentError) end it 'should not initialize without password' do lambda do User.login(:email => 'valid_email', :password => nil) end.should raise_error(ArgumentError) end end describe User, ', once logged in,' do before(:each) do mock_successful(:authenticate) @user = User.login(:email => 'valid_email', :password => 'valid_password') end it 'should provide one or more tumblelogs' do @user.tumblelogs.size.should == 2 end it 'should provide *only* tumblelogs' do @user.tumblelogs.all? { |obj| obj.should be_an_instance_of(Tumblelog) } end it 'should provide a primary tumblelog' do primary = @user.primary_tumblelog primary.is_primary.should == 'yes' end end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
hexorx-rumblr-0.0.3 | spec/rumblr/user_spec.rb |
hexorx-rumblr-0.0.4 | spec/rumblr/user_spec.rb |
jamescallmebrent-rumblr-0.0.2 | spec/rumblr/user_spec.rb |