* Removed Pixa/Tinami sources
* Upgraded to Rails 3.2.3 * Fixed tests
This commit is contained in:
@@ -3,12 +3,12 @@ require 'test_helper'
|
||||
class CommentsControllerTest < ActionController::TestCase
|
||||
context "A comments controller" do
|
||||
setup do
|
||||
CurrentUser.user = Factory.create(:user)
|
||||
CurrentUser.user = FactoryGirl.create(:user)
|
||||
CurrentUser.ip_addr = "127.0.0.1"
|
||||
Danbooru.config.stubs(:member_comment_time_threshold).returns(1.week.from_now)
|
||||
@post = Factory.create(:post)
|
||||
@comment = Factory.create(:comment, :post => @post)
|
||||
@user = Factory.create(:moderator_user)
|
||||
@post = FactoryGirl.create(:post)
|
||||
@comment = FactoryGirl.create(:comment, :post => @post)
|
||||
@user = FactoryGirl.create(:moderator_user)
|
||||
end
|
||||
|
||||
teardown do
|
||||
@@ -38,7 +38,7 @@ class CommentsControllerTest < ActionController::TestCase
|
||||
context "create action"do
|
||||
should "create a comment" do
|
||||
assert_difference("Comment.count", 1) do
|
||||
post :create, {:comment => Factory.attributes_for(:comment, :post_id => @post.id)}, {:user_id => @user.id}
|
||||
post :create, {:comment => FactoryGirl.attributes_for(:comment, :post_id => @post.id)}, {:user_id => @user.id}
|
||||
end
|
||||
comment = Comment.last
|
||||
assert_redirected_to post_path(comment.post)
|
||||
|
||||
Reference in New Issue
Block a user