require File.dirname(__FILE__) + '/../integration_helper' describe Locomotive::Steam::Server do include Rack::Test::Methods def app run_server end it 'displays an error message if the site does not exist' do get '/index', {},{ 'HTTP_HOST' => 'www.nowhere.org/index' } expect(last_response.status).to eq(404) expect(last_response.body).to eq 'Hi, we are sorry but no site was found.' end it 'shows the index page' do get '/index' expect(last_response.status).to eq(200) expect(last_response.body).to match(/Upcoming events/) end it 'shows the about us page' do get '/about-us' expect(last_response.status).to eq(200) end it 'shows an inner page' do get '/about-us/jane-doe' expect(last_response.body).to include 'A complicated one name indeed.
' end end describe 'templatized page' do it 'shows a content type template' do get '/songs/song-number-1' expect(last_response.body).to include 'another version' end it 'renders a page under a templatized one' do get '/songs/song-number-2/band' expect(last_response.body).to include 'Song #2' expect(last_response.body).to include 'Leader: Eddie' end it 'redirects to the 404 if it does not match a content entry' do get '/songs/unknown' expect(last_response).to be_redirect follow_redirect! expect(last_response.status).to eq(404) end end describe 'translations' do it 'translates strings' do get '/' expect(last_response.body).to include 'Powered by' get '/fr' expect(last_response.body).to include 'Propulsé par' end it 'provides translation in scopes' do get '/' expect(last_response.body).to match /scoped_translation=.French./ end it 'translates a page with link_to tags inside' do get '/fr/notre-musique' expect(last_response.body).to include '