Sha256: d9c72d29830cf98d361fe8060e578aaffac477cd81c4f0d3bbde49e2cee86e2e

Contents?: true

Size: 401 Bytes

Versions: 142

Compression:

Stored size: 401 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 = File.join("spec", "fixtures", "#{file}.response")
    File.exists?(file) ? File.read(file) : ""
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
onebox-1.5.34 spec/support/html_spec_helper.rb
onebox-1.5.33 spec/support/html_spec_helper.rb
onebox-1.5.32 spec/support/html_spec_helper.rb
onebox-1.5.31 spec/support/html_spec_helper.rb
onebox-1.5.30 spec/support/html_spec_helper.rb
onebox-1.5.29 spec/support/html_spec_helper.rb
onebox-1.5.28 spec/support/html_spec_helper.rb
onebox-1.5.27 spec/support/html_spec_helper.rb
onebox-1.5.26 spec/support/html_spec_helper.rb
onebox-1.5.25 spec/support/html_spec_helper.rb
onebox-1.5.24 spec/support/html_spec_helper.rb
onebox-1.5.23 spec/support/html_spec_helper.rb
onebox-1.5.22 spec/support/html_spec_helper.rb
onebox-1.5.21 spec/support/html_spec_helper.rb
onebox-1.5.20 spec/support/html_spec_helper.rb
onebox-1.5.19 spec/support/html_spec_helper.rb
onebox-1.5.18 spec/support/html_spec_helper.rb
onebox-1.5.17 spec/support/html_spec_helper.rb
onebox-1.5.16 spec/support/html_spec_helper.rb
onebox-1.5.14 spec/support/html_spec_helper.rb