fix functional tests

This commit is contained in:
albert
2012-01-15 17:04:22 -05:00
parent 0887c35922
commit 4283bce8b9
6 changed files with 15 additions and 10 deletions

View File

@@ -3,7 +3,7 @@ require 'test_helper'
class PostVotesControllerTest < ActionController::TestCase
context "The post vote controller" do
setup do
@user = Factory.create(:user)
@user = Factory.create(:privileged_user)
CurrentUser.user = @user
CurrentUser.ip_addr = "127.0.0.1"
@post = Factory.create(:post)
@@ -17,6 +17,7 @@ class PostVotesControllerTest < ActionController::TestCase
context "create action" do
should "increment a post's score if the score is positive" do
post :create, {:post_id => @post.id, :score => "up", :format => "js"}, {:user_id => @user.id}
assert_response :success
@post.reload
assert_equal(1, @post.score)
end