Skip to content

Instantly share code, notes, and snippets.

@trystant
Created June 1, 2009 14:34
Show Gist options
  • Save trystant/121452 to your computer and use it in GitHub Desktop.
Save trystant/121452 to your computer and use it in GitHub Desktop.
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