finished dmails and favorites functional tests

This commit is contained in:
albert
2010-12-05 22:27:45 -05:00
parent b18f6340e7
commit 46164eab4f
25 changed files with 226 additions and 48 deletions

View File

@@ -3,21 +3,23 @@ class FavoritesController < ApplicationController
if params[:tags]
redirect_to(posts_path(:tags => "fav:#{CurrentUser.name} #{params[:tags]}"))
else
@posts = PostSets::Favorite.new(CurrentUser.user)
@post_set = PostSets::Favorite.new(CurrentUser.user)
end
end
def create
@favorite = Favorite.create(
:user_id => CurrentUser.id,
:post_id => params[:favorite][:post_id]
:post_id => params[:id]
)
render :nothing => true
end
def destroy
Favorite.destroy(
:user_id => CurrentUser.id,
:post_id => params[:favorite][:post_id]
:post_id => params[:id]
)
render :nothing => true
end
end