Created
June 1, 2009 14:34
-
-
Save trystant/121452 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
describe AccountProxy, 'associations' do | |
it 'should belong to an account' do | |
AccountProxy.new.should belong_to(:account) | |
end | |
it 'should belong to a point source' do | |
AccountProxy.new.should belong_to(:point_source) | |
end | |
it 'should have many transfers' do | |
AccountProxy.new.should have_many(:transfers) | |
end | |
end | |
describe AccountProxy, 'validations' do | |
before :each do | |
@active_status = LISTS['account_proxy_status'].map{|option| option[1]}.first | |
@account = Account.new(:balance => 1000) | |
@account_proxy = AccountProxy.new(:share_percentage => 5, :account => @account, :status_code => @active_status) | |
end | |
it 'should require an account' do | |
@account_proxy.should validate_presence_of(:account) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment