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.8.18 spec/support/html_spec_helper.rb
onebox-1.8.17 spec/support/html_spec_helper.rb
onebox-1.8.16 spec/support/html_spec_helper.rb
onebox-1.8.15 spec/support/html_spec_helper.rb
onebox-1.8.14 spec/support/html_spec_helper.rb
onebox-1.8.13 spec/support/html_spec_helper.rb
onebox-1.8.12 spec/support/html_spec_helper.rb
onebox-1.8.11 spec/support/html_spec_helper.rb
onebox-1.8.10 spec/support/html_spec_helper.rb
onebox-1.8.9 spec/support/html_spec_helper.rb
onebox-1.8.8 spec/support/html_spec_helper.rb
onebox-1.8.7 spec/support/html_spec_helper.rb
onebox-1.8.6 spec/support/html_spec_helper.rb
onebox-1.8.5 spec/support/html_spec_helper.rb
onebox-1.8.4 spec/support/html_spec_helper.rb
onebox-1.8.3 spec/support/html_spec_helper.rb
onebox-1.8.2 spec/support/html_spec_helper.rb
onebox-1.8.1 spec/support/html_spec_helper.rb
onebox-1.8.0 spec/support/html_spec_helper.rb
onebox-1.7.9 spec/support/html_spec_helper.rb