Sha256: 492f1e41de39dc494f2d61f8738de972cac6432ebb4b6d84e417426b2db5763b

Contents?: true

Size: 429 Bytes

Versions: 3

Compression:

Stored size: 429 Bytes

Contents

require 'spec_helper'
require 'rail/request'

RSpec.describe Rail::Request do
  describe '#path' do
    it 'appends .html when no extension is given' do
      env = { 'PATH_INFO' => '/foo/bar' }
      expect(described_class.new(env).path).to eq '/foo/bar.html'
    end

    it 'substitutes /index.html for /' do
      env = { 'PATH_INFO' => '/' }
      expect(described_class.new(env).path).to eq '/index.html'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rail-0.1.1 spec/lib/rail/request_spec.rb
rail-0.1.0 spec/lib/rail/request_spec.rb
rail-0.0.8 spec/lib/rail/request_spec.rb