fix tests
This commit is contained in:
@@ -26,12 +26,10 @@ if defined?(MEMCACHE)
|
|||||||
end
|
end
|
||||||
|
|
||||||
class ActiveSupport::TestCase
|
class ActiveSupport::TestCase
|
||||||
include UploadTestMethods
|
|
||||||
include PostArchiveTestHelper
|
include PostArchiveTestHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
class ActionController::TestCase
|
class ActionController::TestCase
|
||||||
include UploadTestMethods
|
|
||||||
include PostArchiveTestHelper
|
include PostArchiveTestHelper
|
||||||
|
|
||||||
def assert_authentication_passes(action, http_method, role, params, session)
|
def assert_authentication_passes(action, http_method, role, params, session)
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ class PostTest < ActiveSupport::TestCase
|
|||||||
assert_equal(posts.map(&:id), Post.tag_match(query).pluck(:id))
|
assert_equal(posts.map(&:id), Post.tag_match(query).pluck(:id))
|
||||||
end
|
end
|
||||||
|
|
||||||
setup do
|
def setup
|
||||||
|
super
|
||||||
|
|
||||||
Timecop.travel(2.weeks.ago) do
|
Timecop.travel(2.weeks.ago) do
|
||||||
@user = FactoryGirl.create(:user)
|
@user = FactoryGirl.create(:user)
|
||||||
end
|
end
|
||||||
@@ -20,7 +22,9 @@ class PostTest < ActiveSupport::TestCase
|
|||||||
mock_saved_search_service!
|
mock_saved_search_service!
|
||||||
end
|
end
|
||||||
|
|
||||||
teardown do
|
def teardown
|
||||||
|
super
|
||||||
|
|
||||||
CurrentUser.user = nil
|
CurrentUser.user = nil
|
||||||
CurrentUser.ip_addr = nil
|
CurrentUser.ip_addr = nil
|
||||||
end
|
end
|
||||||
@@ -2290,8 +2294,8 @@ class PostTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
context "a post that has been updated" do
|
context "a post that has been updated" do
|
||||||
setup do
|
setup do
|
||||||
@post = FactoryGirl.create(:post, :rating => "q", :tag_string => "aaa")
|
|
||||||
PostArchive.sqs_service.stubs(:merge?).returns(false)
|
PostArchive.sqs_service.stubs(:merge?).returns(false)
|
||||||
|
@post = FactoryGirl.create(:post, :rating => "q", :tag_string => "aaa", :source => nil)
|
||||||
@post.update_attributes(:tag_string => "aaa bbb ccc ddd")
|
@post.update_attributes(:tag_string => "aaa bbb ccc ddd")
|
||||||
@post.update_attributes(:tag_string => "bbb xxx yyy", :source => "xyz")
|
@post.update_attributes(:tag_string => "bbb xxx yyy", :source => "xyz")
|
||||||
@post.update_attributes(:tag_string => "bbb mmm yyy", :source => "abc")
|
@post.update_attributes(:tag_string => "bbb mmm yyy", :source => "abc")
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class PostVoteTest < ActiveSupport::TestCase
|
class PostVoteTest < ActiveSupport::TestCase
|
||||||
setup do
|
def setup
|
||||||
|
super
|
||||||
|
|
||||||
user = FactoryGirl.create(:user)
|
user = FactoryGirl.create(:user)
|
||||||
CurrentUser.user = user
|
CurrentUser.user = user
|
||||||
CurrentUser.ip_addr = "127.0.0.1"
|
CurrentUser.ip_addr = "127.0.0.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user