Sha256: 51caa54d7299ef5bcfecef09f4fe9fc7b280c023d487639f23bdfc0e124c2c4b

Contents?: true

Size: 633 Bytes

Versions: 18

Compression:

Stored size: 633 Bytes

Contents

libdir = File.expand_path("lib")
$:.unshift(libdir) unless $:.include?(libdir)

module CallWithMockRequestMixin
  def call_with_mock_request(url = "/sample", method = "GET", params = Hash.new)
    params.merge!(:method => method)
    request = Rack::MockRequest.new(self)
    request.request(method, url, params)
  end
end

class MockApp
  attr_accessor :status, :headers, :body, :env
  def initialize(body)
    @status  = 200
    @headers = {"Content-Type" => "text/html"}
    @body    = body
  end

  def call(env)
    @env = env
    @headers.merge("Content-Length" => @body.length.to_s)
    [@status, @headers, [@body]]
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
joshbuddy-usher-0.5.7 spec/spec_helper.rb
usher-0.7.1 spec/spec_helper.rb
usher-0.7.0 spec/spec_helper.rb
usher-0.6.8 spec/spec_helper.rb
usher-0.6.7 spec/spec_helper.rb
usher-0.6.6 spec/spec_helper.rb
usher-0.6.5 spec/spec_helper.rb
usher-0.6.4 spec/spec_helper.rb
usher-0.6.3 spec/spec_helper.rb
usher-0.6.2 spec/spec_helper.rb
usher-0.6.1 spec/spec_helper.rb
usher-0.6.0 spec/spec_helper.rb
usher-0.5.13 spec/spec_helper.rb
usher-0.5.12 spec/spec_helper.rb
usher-0.5.11 spec/spec_helper.rb
usher-0.5.10 spec/spec_helper.rb
usher-0.5.8 spec/spec_helper.rb
usher-0.5.7 spec/spec_helper.rb