finished dmails and favorites functional tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user