fixed tests
This commit is contained in:
@@ -79,10 +79,23 @@ class ForumTopicsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "destroy the topic and any associated posts" do
|
||||
assert_difference(["ForumPost.count", "ForumTopic.count"], -1) do
|
||||
post :destroy, {:id => @forum_topic.id}, {:user_id => @user.id}
|
||||
end
|
||||
assert_redirected_to(forum_topics_path)
|
||||
post :destroy, {:id => @forum_topic.id}, {:user_id => @user.id}
|
||||
assert_redirected_to(forum_topic_path(@forum_topic))
|
||||
@forum_topic.reload
|
||||
assert_equal(true, @forum_topic.is_deleted?)
|
||||
end
|
||||
end
|
||||
|
||||
context "undelete action" do
|
||||
setup do
|
||||
@forum_topic.update_attribute(:is_deleted, true)
|
||||
end
|
||||
|
||||
should "restore the topic" do
|
||||
post :undelete, {:id => @forum_topic.id}, {:user_id => @user.id}
|
||||
assert_redirected_to(forum_topic_path(@forum_topic))
|
||||
@forum_topic.reload
|
||||
assert_equal(false, @forum_topic.is_deleted?)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user