require File.dirname(__FILE__) + '/../integration_helper' describe Locomotive::Steam::Server do include Rack::Test::Methods def app run_server end it "converts {{ page.templatized? }} => true on templatized page" do get '/songs/song-number-1' last_response.body.should =~ /templatized=.true./ end it "converts {{ page.templatized? }} => false on regular page" do get '/index' last_response.body.should =~ /templatized=.false./ end it "converts {{ page.listed? }} => true on listed page" do get '/music' last_response.body.should =~ /listed=.true./ end it "provides an access to page's content_type collection" do get '/songs/song-number-1' last_response.body.should =~ /content_type_size=.8./ end it "provides count alias on collections" do get '/songs/song-number-1' last_response.body.should =~ /content_type_count=.8./ end describe '.link_to' do it "writes a link to a page" do get '/events' last_response.body.should =~ /Discover: Music<\/a>/ end it "writes a localized a link" do get '/events' last_response.body.should =~ /Plus à notre sujet: Qui sommes nous \?<\/a>/ end it "writes a link to a page with a custom label" do get '/events' last_response.body.should =~ /More about us: Who are we \?<\/a>/ end it "writes a link to a templatized page" do get '/events' last_response.body.should =~ /Song #1<\/a>/ end it "writes a link to a templatized page with a different handle" do get '/events' last_response.body.should =~ /Song #8<\/a>/ end end describe 'scope & assigns' do it "evaluates collection when called all inside of scope" do get '/music' last_response.body.should =~ /

Song #3/ last_response.body.should =~ /

\s+Song #3/m end it "size of evaluated unscoped collection equal to unevaluated one" do get '/music' last_response.body.should =~ /class=.collection_equality.>8=8/ end end describe 'html helpers' do it 'bypass url for css resource' do get '/' last_response.body.should =~ /