Merge branch 'master' into attribute-searching
This commit is contained in:
@@ -8,11 +8,11 @@ class ModActionsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
context "index action" do
|
||||
setup do
|
||||
@promote_action = create(:mod_action, category: "user_level_change", creator: build(:builder_user, name: "rumia"))
|
||||
@unrelated_action = create(:mod_action)
|
||||
@ban = create(:mod_action, category: :post_ban)
|
||||
@unban = create(:mod_action, category: :post_unban)
|
||||
end
|
||||
|
||||
should "render" do
|
||||
should "work" do
|
||||
get mod_actions_path
|
||||
assert_response :success
|
||||
end
|
||||
@@ -25,10 +25,24 @@ class ModActionsControllerTest < ActionDispatch::IntegrationTest
|
||||
should respond_to_search(creator_name: "rumia").with { @promote_action }
|
||||
should respond_to_search(creator: {level: User::Levels::BUILDER}).with { @promote_action }
|
||||
end
|
||||
|
||||
context "category enum searches" do
|
||||
should respond_to_search(category: "post_ban").with { [@ban] }
|
||||
should respond_to_search(category: "post_unban").with { [@unban] }
|
||||
should respond_to_search(category: "Post_ban").with { [@ban] }
|
||||
should respond_to_search(category: "post_ban post_unban").with { [@unban, @ban] }
|
||||
should respond_to_search(category: "post_ban,post_unban").with { [@unban, @ban] }
|
||||
should respond_to_search(category: "44").with { [@ban] }
|
||||
should respond_to_search(category_id: "44").with { [@ban] }
|
||||
should respond_to_search(category_id: "44,45").with { [@unban, @ban] }
|
||||
should respond_to_search(category_id: ">=44").with { [@unban, @ban] }
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
context "show action" do
|
||||
should "work" do
|
||||
@mod_action = create(:mod_action)
|
||||
get mod_action_path(@mod_action)
|
||||
assert_redirected_to mod_actions_path(search: { id: @mod_action.id })
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user