Guest User

Untitled

a guest
Apr 16th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. # This test's assert will fail for I don't know why.
  2.  
  3.  
  4. def test_with_user_and_counter_count
  5. user = User.create({:name => 'toyota_man', :password => 'civic'})
  6. make = user.makes.create({:name => 'Toyota'})
  7. print "\n\n USER:" + user.to_yaml + "\n\n"
  8. print "__________________________________________________________________________________"
  9. print "\n\n MAKE:" + make.to_yaml + "\n\n"
  10. #assert user.makes_count == 1
  11. end
  12.  
  13. # Result is:
  14.  
  15. C:\Server\WWW\instabase>ruby test/unit/make_test.rb
  16. Loaded suite test/unit/make_test
  17. Started
  18. .
  19.  
  20. USER:--- &id002 !ruby/object:User
  21. attributes:
  22. name: toyota_man
  23. salt: "328771200.298432512876106"
  24. updated_at: &id001 2008-01-27 18:04:37.203000 +02:00
  25. products_count: 0
  26. installations_count: 0
  27. hashed_password: fe478f3fd50dc4f65b904fb10fbac1ebc4b7d907
  28. makes_count: 0
  29. cars_count: 0
  30. id: 973376604
  31. user_type: user
  32. models_count: 0
  33. created_at: *id001
  34. email:
  35. attributes_cache: {}
  36.  
  37. errors: !ruby/object:ActiveRecord::Errors
  38. base: *id002
  39. errors: {}
  40.  
  41. makes:
  42. - !ruby/object:Make
  43. attributes:
  44. name: Toyota
  45. updated_at: 2008-01-27 18:04:37
  46. cars_count: "0"
  47. is_approved:
  48. id: "996332881"
  49. models_count: "0"
  50. user_id: "973376604"
  51. created_at: 2008-01-27 18:04:37
  52. attributes_cache: {}
  53.  
  54. new_record: false
  55. new_record_before_save: true
  56. password: civic
  57.  
  58.  
  59. __________________________________________________________________________________
  60.  
  61. MAKE:--- &id002 !ruby/object:Make
  62. attributes:
  63. name: Toyota
  64. updated_at: &id001 2008-01-27 18:04:37.203000 +02:00
  65. cars_count: 0
  66. id: 996332881
  67. is_approved:
  68. models_count: 0
  69. user_id: 973376604
  70. created_at: *id001
  71. attributes_cache: {}
  72.  
  73. errors: !ruby/object:ActiveRecord::Errors
  74. base: *id002
  75. errors: {}
  76.  
  77. new_record: false
  78. new_record_before_save: true
  79. user: !ruby/object:User
  80. attributes:
  81. name: toyota_man
  82. salt: "328771200.298432512876106"
  83. updated_at: 2008-01-27 18:04:37
  84. products_count: "0"
  85. installations_count: "0"
  86. hashed_password: fe478f3fd50dc4f65b904fb10fbac1ebc4b7d907
  87. makes_count: "0"
  88. cars_count: "0"
  89. id: "973376604"
  90. user_type: user
  91. models_count: "0"
  92. created_at: 2008-01-27 18:04:37
  93. email:
  94. attributes_cache: {}
  95.  
  96.  
  97.  
  98. .
  99. Finished in 0.156 seconds.
  100.  
  101. 2 tests, 3 assertions, 0 failures, 0 errors
  102.  
  103. C:\Server\WWW\instabase>
Add Comment
Please, Sign In to add comment