Sha256: de0dcb0cf38d40aacd38b9ad9b6e16819823552fb10c372e019279295064d6c7

Contents?: true

Size: 359 Bytes

Versions: 1

Compression:

Stored size: 359 Bytes

Contents

module HTMLSpecHelper
  def fake(uri, response, verb = :get)
    FakeWeb.register_uri(verb, uri, response: header(response))
  end

  def header(html)
    "HTTP/1.1 200 OK\n\n#{html}"
  end

  def onebox_view(html)
    %|<div class="onebox">#{html}</div>|
  end

  def response(file)
    File.read(File.join("spec", "fixtures", "#{file}.response"))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onebox-1.1.0 spec/support/html_spec_helper.rb