Browse files

passing favorites tests

  • Loading branch information...
1 parent 38314a4 commit a6e2d1bb7ba589c95edf4a40a31ec1baf74c93b3 @blahed committed Nov 15, 2012
Showing with 9 additions and 16 deletions.
  1. +0 −9 test/helpers/favorites_helper_test.rb
  2. +9 −7 test/models/user_test.rb
View
9 test/helpers/favorites_helper_test.rb
@@ -1,9 +0,0 @@
-require "minitest_helper"
-
-describe FavoritesHelper do
-
- it "must be a real test" do
- flunk "Need real tests"
- end
-
-end
View
16 test/models/user_test.rb
@@ -11,10 +11,12 @@
@user.favorites.must_be :empty?
- @user.favorite(web_account)
- @user.favorite(note)
+ @user.favorite!(web_account)
+ @user.favorite!(note)
@user.reload
+ @user.has_favorite?(web_account).wont_be_nil
+ @user.has_favorite?(note).wont_be_nil
@user.favorites.size.must_equal 2
end
@@ -24,14 +26,14 @@
@user.favorites.must_be :empty?
- @user.favorite(web_account)
- @user.favorite(note)
+ @user.favorite!(web_account)
+ @user.favorite!(note)
@user.reload
- @user.defavorite(note)
+ @user.defavorite!(note)
@user.reload
- @user.favorites.has_key?(web_account._id.to_s).must_equal true
- @user.favorites.has_key?(note._id.to_s).must_equal false
+ @user.has_favorite?(web_account).wont_be_nil
+ @user.has_favorite?(note).must_be_nil
@user.favorites.size.must_equal 1
end

0 comments on commit a6e2d1b

Please sign in to comment.