Sha256: c54231cb9f6587c8c997ac1be4aceb28d6cad6da084aa3f01367364a353e3295

Contents?: true

Size: 898 Bytes

Versions: 14

Compression:

Stored size: 898 Bytes

Contents

require 'helper'
require 'rack/lobster'

class TestVitrineInRackStack < Test::Unit::TestCase
  include Rack::Test::Methods, VitrineTesting
  
  def app
    td = temporary_app_dir
    outer = Rack::Builder.new do
      # The outer app
      use Vitrine::App do |v|
        v.settings.set root: td
      end
      
      # And a lobster downstream
      map "/lobster" do
        run Rack::Lobster.new
      end
    end
    outer.to_app
  end
  
  def test_lobster
    get '/lobster'
    assert last_response.ok?
    assert_match /Lobstericious/, last_response.body, "Should have forwarded to downstream Lobster"
  end
  
  def test_fetch_js
    write_public('hello.coffee') do | f |
      f << 'window.alert "Hello Coffee"'
    end
    
    get '/hello.js'
    assert last_response.ok?
    assert_include last_response.body, 'window.alert("Hello Coffee")', "Should include the JS fragment"
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vitrine-0.0.28 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.27 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.26 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.25 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.24 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.23 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.22 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.21 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.19 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.18 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.17 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.16 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.15 test/test_vitrine_in_rack_stack.rb
vitrine-0.0.14 test/test_vitrine_in_rack_stack.rb