Sha256: 8691a1869ff34f19e619e2b501dae446add2f7d7f0e7bf19cc2c3c79f9392053

Contents?: true

Size: 734 Bytes

Versions: 6

Compression:

Stored size: 734 Bytes

Contents

require 'spec_helper'
require 'phrender/rack_static'

describe 'Phrender::RackStatic' do
  let(:root) { File.expand_path '../rack_static', __FILE__ }
  let(:app) {
    Phrender::RackStatic.new({
      :asset_root => root,
      :index_file => 'phrender.html',
      :javascript_files => [
        'app.js'
      ],
      :javascript => [
        "App.run()"
      ]
    })
  }

  it 'runs the app contained in the referenced assets' do
    get('/')
    expect(last_response.body).to eq('<html><head><title>Phrender The Prerenderer</title></head><body><p>Hello!</p></body></html>')
  end

  it 'resolves static assets' do
    get('/files/static.txt')
    expect(last_response.body.strip).to eq('The body of a static file.')
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
phrender-0.0.7 spec/phrender/rack_static_spec.rb
phrender-0.0.6 spec/phrender/rack_static_spec.rb
phrender-0.0.5 spec/phrender/rack_static_spec.rb
phrender-0.0.4 spec/phrender/rack_static_spec.rb
phrender-0.0.3 spec/phrender/rack_static_spec.rb
phrender-0.0.2 spec/phrender/rack_static_spec.rb