Sha256: 504ae8b553aaa71d608a2eea6e7cd715878701dddd02945467d215452bb3f121

Contents?: true

Size: 361 Bytes

Versions: 2

Compression:

Stored size: 361 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)
    Nokogiri::HTML(File.read(File.join("spec", "fixtures", file)))
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
onebox-1.0.1 spec/support/html_spec_helper.rb
onebox-1.0.0 spec/support/html_spec_helper.rb