tests: add respond_to_search test helper.
Add a `respond_to_search` test helper for concisely testing that a
controller's index action correctly responds to a search. Usage:
# Tests that `/tags.json?search[name]=touhou` returns the `touhou` tag.
setup { @touhou = create(:tag, name: "touhou") }
should respond_to_search(name: "touhou").with { @touhou }
This commit is contained in:
@@ -61,6 +61,8 @@ class ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
class ActionDispatch::IntegrationTest
|
||||
extend ControllerHelper
|
||||
|
||||
register_encoder :xml, response_parser: ->(body) { Nokogiri.XML(body) }
|
||||
|
||||
def method_authenticated(method_name, url, user, **options)
|
||||
|
||||
Reference in New Issue
Block a user