Files
danbooru/test/functional/moderator/ip_addrs_controller_test.rb
albert 17881068e1 * Removed Pixa/Tinami sources
* Upgraded to Rails 3.2.3
* Fixed tests
2012-06-01 19:22:58 -04:00

36 lines
1016 B
Ruby

require 'test_helper'
module Moderator
class IpAddrsControllerTest < ActionController::TestCase
context "The ip addrs controller" do
setup do
@user = FactoryGirl.create(:moderator_user)
CurrentUser.user = @user
CurrentUser.ip_addr = "127.0.0.1"
FactoryGirl.create(:comment)
MEMCACHE.flush_all
end
should "find by ip addr" do
get :index, {:search => {:ip_addr_eq => "127.0.0.1"}}, {:user_id => @user.id}
assert_response :success
end
should "find by user id" do
get :index, {:search => {:user_id_eq => @user.id.to_s}}, {:user_id => @user.id}
assert_response :success
end
should "find by user name" do
get :index, {:search => {:user_name_eq => @user.name}}, {:user_id => @user.id}
assert_response :success
end
should "render the search page" do
get :search, {}, {:user_id => @user.id}
assert_response :success
end
end
end
end