refactored search
This commit is contained in:
@@ -19,7 +19,7 @@ class ArtistVersionsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "get the index page when searching for something" do
|
||||
get :index, {:search => {:name_equals => @artist.name}}
|
||||
get :index, {:search => {:name => @artist.name}}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,7 +35,7 @@ class IpBansControllerTest < ActionController::TestCase
|
||||
|
||||
context "with search parameters" do
|
||||
should "render" do
|
||||
get :index, {:search => {:ip_addr_equals => "1.2.3.4"}}, {:user_id => @admin.id}
|
||||
get :index, {:search => {:ip_addr => "1.2.3.4"}}, {:user_id => @admin.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -68,7 +68,7 @@ class JanitorTrialsControllerTest < ActionController::TestCase
|
||||
|
||||
context "with search parameters" do
|
||||
should "render" do
|
||||
get :index, {:search => {:user_name_equals => @user.name}}, {:user_id => @admin.id}
|
||||
get :index, {:search => {:user_name => @user.name}}, {:user_id => @admin.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,17 +12,17 @@ module Moderator
|
||||
end
|
||||
|
||||
should "find by ip addr" do
|
||||
get :index, {:search => {:ip_addr_eq => "127.0.0.1"}}, {:user_id => @user.id}
|
||||
get :index, {:search => {:ip_addr => "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}
|
||||
get :index, {:search => {:user_id => @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}
|
||||
get :index, {:search => {:user_name => @user.name}}, {:user_id => @user.id}
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class NoteVersionsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "list all versions that match the search criteria" do
|
||||
get :index, {:search => {:updater_id_equals => @user_2.id}}
|
||||
get :index, {:search => {:updater_id => @user_2.id}}
|
||||
assert_response :success
|
||||
assert_not_nil(assigns(:note_versions))
|
||||
assert_equal(1, assigns(:note_versions).size)
|
||||
|
||||
@@ -36,7 +36,7 @@ class PoolVersionsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "list all versions that match the search criteria" do
|
||||
get :index, {:search => {:updater_id_equals => @user_2.id}}
|
||||
get :index, {:search => {:updater_id => @user_2.id}}
|
||||
assert_response :success
|
||||
assert_not_nil(assigns(:pool_versions))
|
||||
assert_equal(1, assigns(:pool_versions).size)
|
||||
|
||||
@@ -33,7 +33,7 @@ class PostAppealsControllerTest < ActionController::TestCase
|
||||
|
||||
context "with search parameters" do
|
||||
should "render" do
|
||||
get :index, {:search => {:post_id_equals => @post_appeal.post_id}}, {:user_id => @user.id}
|
||||
get :index, {:search => {:post_id => @post_appeal.post_id}}, {:user_id => @user.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,7 +33,7 @@ class PostFlagsControllerTest < ActionController::TestCase
|
||||
|
||||
context "with search parameters" do
|
||||
should "render" do
|
||||
get :index, {:search => {:post_id_equals => @post_flag.post_id}}, {:user_id => @user.id}
|
||||
get :index, {:search => {:post_id => @post_flag.post_id}}, {:user_id => @user.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -27,7 +27,7 @@ class PostVersionsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "list all versions that match the search criteria" do
|
||||
get :index, {:search => {:post_id_equals => @post.id}}
|
||||
get :index, {:search => {:post_id => @post.id}}
|
||||
assert_response :success
|
||||
assert_not_nil(assigns(:post_versions))
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@ class TagAliasesControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "list all tag_aliass (with search)" do
|
||||
get :index, {:search => {:antecedent_name_matches => "aaa"}}
|
||||
get :index, {:search => {:antecedent_name => "aaa"}}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@ class TagImplicationsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "list all tag_implications (with search)" do
|
||||
get :index, {:search => {:antecedent_name_matches => "aaa"}}
|
||||
get :index, {:search => {:antecedent_name => "aaa"}}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -36,7 +36,7 @@ class TagsControllerTest < ActionController::TestCase
|
||||
|
||||
context "with search parameters" do
|
||||
should "render" do
|
||||
get :index, {:search => {:name_equals => "aaa"}}
|
||||
get :index, {:search => {:name_matches => "aaa"}}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -44,7 +44,7 @@ class UploadsControllerTest < ActionController::TestCase
|
||||
|
||||
context "with search parameters" do
|
||||
should "render" do
|
||||
get :index, {:search => {:source_equals => @upload.source}}, {:user_id => @user.id}
|
||||
get :index, {:search => {:source => @upload.source}}, {:user_id => @user.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -44,7 +44,7 @@ class UserFeedbacksControllerTest < ActionController::TestCase
|
||||
|
||||
context "with search parameters" do
|
||||
should "render" do
|
||||
get :index, {:search => {:user_id_equals => @user.id}}, {:user_id => @critic.id}
|
||||
get :index, {:search => {:user_id => @user.id}}, {:user_id => @critic.id}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
@@ -27,7 +27,7 @@ class WikiPageVersionsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "list all versions that match the search criteria" do
|
||||
get :index, {:search => {:wiki_page_id_equals => @wiki_page.id}}
|
||||
get :index, {:search => {:wiki_page_id => @wiki_page.id}}
|
||||
assert_response :success
|
||||
assert_not_nil(assigns(:wiki_page_versions))
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ class WikiPagesControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "list all wiki_pages (with search)" do
|
||||
get :index, {:search => {:title_matches => "abc"}}
|
||||
get :index, {:search => {:title => "abc"}}
|
||||
assert_redirected_to(wiki_page_path(@wiki_page_abc))
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user