class Picky::TestClient
Attributes
request[R]
Public Class Methods
new(rack_app, options = {})
click to toggle source
Example:
Picky::TestClient.new(BookSearch, :path => '/books')
Calls superclass method
Picky::Client::new
# File lib/picky-client/spec/test_client.rb, line 12 def initialize rack_app, options = {} super options @request = ::Rack::MockRequest.new rack_app end
Public Instance Methods
search(query, params = {})
click to toggle source
Wraps the search method to always extend the result with Convenience
.
Calls superclass method
Picky::Client#search
# File lib/picky-client/spec/test_client.rb, line 20 def search query, params = {} super.extend Convenience end
send_search(params = {})
click to toggle source
Backend method that we override to not send a real search.
# File lib/picky-client/spec/test_client.rb, line 26 def send_search params = {} params = defaultize params request.get("#{self.path}?#{params.to_query}").body end