Sha256: a1dc296fc65ad0ae776c4d1d7f4d6bf3a902db26c57bf4ce47c0f4d0cbf9be5e

Contents?: true

Size: 975 Bytes

Versions: 7

Compression:

Stored size: 975 Bytes

Contents

require 'spec_helper'

describe Massimo::Server do
  let(:app) { Massimo::Server.new(Massimo.site) }
  
  it 'serves up static files' do
    with_file 'public/stylesheets/main.css', 'body { font-size: 12px; }' do
      get '/stylesheets/main.css'
      last_response.body.should == 'body { font-size: 12px; }'
    end
  end
  
  it 'serves up directory index files' do
    with_file 'public/about-us/index.html', 'About Us' do
      get '/about-us/'
      last_response.body.should == 'About Us'
    end
  end
  
  context 'when files have changed' do
    it 'processes the site on request' do
      with_file 'pages/index.haml' do
        mock(Massimo.site).process
        get '/'
      end
    end
  end
  
  context 'when files have not changed' do
    it 'does not process the site on request' do
      with_file 'pages/index.haml' do
        mock(Massimo.site).process
        get '/'
        dont_allow(Massimo.site).process
        get '/'
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
massimo-0.10.3 spec/massimo/server_spec.rb
massimo-0.10.2 spec/massimo/server_spec.rb
massimo-0.10.1 spec/massimo/server_spec.rb
massimo-0.10.0 spec/massimo/server_spec.rb
massimo-0.9.0 spec/massimo/server_spec.rb
massimo-0.8.5 spec/massimo/server_spec.rb
massimo-0.8.4 spec/massimo/server_spec.rb