Sha256: e750e258a5eb9f0ae5136c0c10bb8b6c845b5fe7c12e610a71aa637e65d43938

Contents?: true

Size: 766 Bytes

Versions: 4

Compression:

Stored size: 766 Bytes

Contents

require 'spec_helper'

describe 'Locomotive::Middlewares::SeoTrailingSlash' do

  it 'does not process the "/" url' do
    get '/'
    response.status.should_not be(301)
  end

  it 'does not process the "/locomotive/" url' do
    get '/locomotive/'
    response.status.should_not be(301)
  end

  it 'does not process the "/locomotive/*" urls' do
    get '/locomotive/login'
    response.status.should_not be(301)
  end

  it 'redirects to the url without the trailing slash' do
    get '/hello_world/'
    response.status.should be(301)
  end

  it 'removes the trailing slash but preserves the query' do
    get '/hello_world/?test=name'
    response.status.should be(301)
    response.location.should == 'http://www.example.com/hello_world?test=name'
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
locomotive_cms-2.5.7 spec/requests/seo_trailing_slash_spec.rb
locomotive_cms-2.5.6 spec/requests/seo_trailing_slash_spec.rb
locomotive_cms-2.5.6.rc2 spec/requests/seo_trailing_slash_spec.rb
locomotive_cms-2.5.6.rc1 spec/requests/seo_trailing_slash_spec.rb