Created
February 1, 2011 11:35
-
-
Save ch1ago/805740 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
r3@r3:~/apps/nc$ | |
r3@r3:~/apps/nc$ ruby -I"lib:test" "/home/r3/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/user_session_test.rb" "test/unit/helpers/home_helper_test.rb" "test/unit/helpers/site_helper_test.rb" "test/unit/helpers/user_sessions_helper_test.rb" "test/unit/helpers/users_helper_test.rb" "test/unit/helpers/payment_notifications_helper_test.rb" "test/unit/helpers/finance/accounts_helper_test.rb" "test/unit/helpers/finance/balances_helper_test.rb" "test/unit/helpers/finance/transfers_helper_test.rb" "test/unit/helpers/categories_helper_test.rb" "test/unit/helpers/payment_redirection_helper_test.rb" "test/unit/helpers/artists_helper_test.rb" "test/unit/finance/transfer_test.rb" "test/unit/finance/account_test.rb" "test/unit/finance/balance_test.rb" "test/unit/user_test.rb" "test/unit/payment_notification_test.rb" "test/unit/category_test.rb" | |
Loaded suite /home/r3/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake/rake_test_loader | |
Started | |
.F...... | |
Finished in 0.516311 seconds. | |
1) Failure: | |
test_create_system_debit_account(Finance::AccountTest) [test/unit/finance/account_test.rb:11]: | |
{:direction=>["is not included in the list"]} | |
8 tests, 10 assertions, 1 failures, 0 errors, 0 skips | |
Test run options: --seed 46639 | |
r3@r3:~/apps/nc$ |
This file contains hidden or 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
require 'test_helper' | |
class Finance::AccountTest < ActiveSupport::TestCase | |
test "create system debit account" do | |
purpose = :some_purpose.to_s | |
direction = :debit.to_s | |
owner = :system.to_s | |
@acc = Finance::Account.new( :purpose => purpose, :direction => direction, :owner => owner ) | |
assert @acc.save, @acc.errors.to_s | |
end | |
test "create user move account" do | |
u = User.first | |
raise "must have at least one user in the database" unless u | |
purpose = :some_purpose.to_s | |
direction = :move.to_s#GOTTA VALIDATE TRYING TO SAVE INVALID VALUES | |
owner = :user.to_s | |
@acc = Finance::Account.new( :purpose => purpose, :direction => direction, :owner => owner, :user=>u ) | |
assert @acc.save, @acc.errors.to_s | |
end | |
end |
This file contains hidden or 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
module Finance | |
def self.table_name_prefix | |
'finance_' | |
end | |
#VALUES FOR ENUMERATOR | |
DIRECTIONS = %w(move debit credit) | |
#VALUES FOR ENUMERATOR | |
REASONS = %w(some_reason some_other_reason) | |
#VALUES FOR ENUMERATOR | |
OWNERS = %w(system user) | |
#VALUES FOR ENUMERATOR | |
PURPOSES = %w(some_purpose some_other_purpose) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment