Sha256: 9538c3630967a66fe25ae1d461b97c84b72e89362e804f32c62a7da92f9406b2

Contents?: true

Size: 543 Bytes

Versions: 3

Compression:

Stored size: 543 Bytes

Contents

module ViewHelpers
  def request_mock(options={})
    options.reverse_merge! env: {}, host: 'test.dev', path_info: '', port: 80, protocol: 'http://'

    env = { 'action_dispatch.request.query_parameters' => {} }.merge options[:env]

    request = double()
    request.stub(:protocol).and_return options[:protocol]
    request.stub(:host).and_return options[:host]
    request.stub(:port).and_return options[:port]
    request.stub(:path_info).and_return options[:path_info]
    request.stub(:env).and_return env

    return request
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
neat-pages-1.0.2 spec/support/views_helper.rb
neat-pages-1.0.1 spec/support/views_helper.rb
neat-pages-1.0.0 spec/support/views_helper.rb