Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This test's assert will fail for I don't know why.
- def test_with_user_and_counter_count
- user = User.create({:name => 'toyota_man', :password => 'civic'})
- make = user.makes.create({:name => 'Toyota'})
- print "\n\n USER:" + user.to_yaml + "\n\n"
- print "__________________________________________________________________________________"
- print "\n\n MAKE:" + make.to_yaml + "\n\n"
- #assert user.makes_count == 1
- end
- # Result is:
- C:\Server\WWW\instabase>ruby test/unit/make_test.rb
- Loaded suite test/unit/make_test
- Started
- .
- USER:--- &id002 !ruby/object:User
- attributes:
- name: toyota_man
- salt: "328771200.298432512876106"
- updated_at: &id001 2008-01-27 18:04:37.203000 +02:00
- products_count: 0
- installations_count: 0
- hashed_password: fe478f3fd50dc4f65b904fb10fbac1ebc4b7d907
- makes_count: 0
- cars_count: 0
- id: 973376604
- user_type: user
- models_count: 0
- created_at: *id001
- email:
- attributes_cache: {}
- errors: !ruby/object:ActiveRecord::Errors
- base: *id002
- errors: {}
- makes:
- - !ruby/object:Make
- attributes:
- name: Toyota
- updated_at: 2008-01-27 18:04:37
- cars_count: "0"
- is_approved:
- id: "996332881"
- models_count: "0"
- user_id: "973376604"
- created_at: 2008-01-27 18:04:37
- attributes_cache: {}
- new_record: false
- new_record_before_save: true
- password: civic
- __________________________________________________________________________________
- MAKE:--- &id002 !ruby/object:Make
- attributes:
- name: Toyota
- updated_at: &id001 2008-01-27 18:04:37.203000 +02:00
- cars_count: 0
- id: 996332881
- is_approved:
- models_count: 0
- user_id: 973376604
- created_at: *id001
- attributes_cache: {}
- errors: !ruby/object:ActiveRecord::Errors
- base: *id002
- errors: {}
- new_record: false
- new_record_before_save: true
- user: !ruby/object:User
- attributes:
- name: toyota_man
- salt: "328771200.298432512876106"
- updated_at: 2008-01-27 18:04:37
- products_count: "0"
- installations_count: "0"
- hashed_password: fe478f3fd50dc4f65b904fb10fbac1ebc4b7d907
- makes_count: "0"
- cars_count: "0"
- id: "973376604"
- user_type: user
- models_count: "0"
- created_at: 2008-01-27 18:04:37
- email:
- attributes_cache: {}
- .
- Finished in 0.156 seconds.
- 2 tests, 3 assertions, 0 failures, 0 errors
- C:\Server\WWW\instabase>
Add Comment
Please, Sign In to add comment