Sha256: b8890d594ca24e55be9ccd2f59777fb266e29e392adca1352ccd73da84e7948c

Contents?: true

Size: 692 Bytes

Versions: 8

Compression:

Stored size: 692 Bytes

Contents

require 'spec_helper'

describe Machined::Middleware::RootIndex do
  include Rack::Test::Methods

  let(:app) do
    Rack::Builder.new.tap do |app|
      app.use Machined::Middleware::RootIndex
      app.run Proc.new { |env| [200, {'Content-Type' => 'text/plain'}, [env['PATH_INFO']]] }
    end.to_app
  end

  it 'adds index.html to the root index' do
    get('/').body.should == '/index.html'
  end

  it 'does not change the path info for normal files' do
    get('/about').body.should == '/about'
    get('/about.html').body.should == '/about.html'
    get('/about/').body.should == '/about/'
    get('/assets/main.css').body.should == '/assets/main.css'
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
machined-1.1.0 spec/machined/middleware/root_index_spec.rb
machined-1.0.3 spec/machined/middleware/root_index_spec.rb
machined-1.0.2 spec/machined/middleware/root_index_spec.rb
machined-1.0.1 spec/machined/middleware/root_index_spec.rb
machined-1.0.0 spec/machined/middleware/root_index_spec.rb
machined-0.9.3 spec/machined/middleware/root_index_spec.rb
machined-0.9.2 spec/machined/middleware/root_index_spec.rb
machined-0.9.1 spec/machined/middleware/root_index_spec.rb