fix tests

This commit is contained in:
albert
2013-02-17 21:32:07 -05:00
parent 44682156c0
commit eb1ba8f708
4 changed files with 7 additions and 11 deletions

View File

@@ -18,17 +18,17 @@ module Moderator
end
should "find by ip addr" do
@search = IpAddrSearch.new(:ip_addr_eq => "127.0.0.1")
@search = IpAddrSearch.new(:ip_addr => "127.0.0.1")
assert_equal({@user.id.to_s => 2}, @search.execute)
end
should "find by user id" do
@search = IpAddrSearch.new(:user_id_eq => @user.id.to_s)
@search = IpAddrSearch.new(:user_id => @user.id.to_s)
assert_equal({"127.0.0.1" => 2}, @search.execute)
end
should "find by user name" do
@search = IpAddrSearch.new(:user_name_eq => @user.name)
@search = IpAddrSearch.new(:user_name => @user.name)
assert_equal({"127.0.0.1" => 2}, @search.execute)
end
end

View File

@@ -759,7 +759,7 @@ class PostTest < ActiveSupport::TestCase
assert_equal(post1.id, relation.first.id)
end
should "return posts for the <uploader> metatag" do
should "return posts for the <user> metatag" do
second_user = FactoryGirl.create(:user)
post1 = FactoryGirl.create(:post, :uploader => CurrentUser.user)
@@ -770,7 +770,7 @@ class PostTest < ActiveSupport::TestCase
post3 = FactoryGirl.create(:post)
end
relation = Post.tag_match("uploader:#{CurrentUser.user.name}")
relation = Post.tag_match("user:#{CurrentUser.user.name}")
assert_equal(1, relation.count)
assert_equal(post1.id, relation.first.id)
end