fixed tests

This commit is contained in:
albert
2010-11-19 17:20:13 -05:00
parent c6304c6e08
commit f8ab736677
10 changed files with 33 additions and 39 deletions

View File

@@ -1,14 +1,18 @@
class FavoritesController < ApplicationController
def index
@posts = CurrentUser.favorite_posts(params)
end
def create
@favorite = Favorite.create(
:user_id => CurrentUser.user.id,
:user_id => CurrentUser.id,
:post_id => params[:favorite][:post_id]
)
end
def destroy
Favorite.destroy(
:user_id => CurrentUser.user.id,
:user_id => CurrentUser.id,
:post_id => params[:favorite][:post_id]
)
end