Sha256: 39de7801e31b6912beed9e5c316c48fd46503226af8f81a6e01de0ee5125824d

Contents?: true

Size: 1.22 KB

Versions: 3

Compression:

Stored size: 1.22 KB

Contents

require 'teststrap'

context "Application Test:" do

  setup do
    mock_app {
      register Sinatra::Chicago

      template(:foo) { ".bar\n  :display none" }
      template(:goo) { ".car\n  :display some" }
      template(:baz) { "Whatever man. That's just like, your opinion." }

      catch_all_css
      catch_all_css('/css')

      get_obvious 'baz'
    }
  end

  # TODO: change to namespace
  context "catching all css" do
    context "with default path" do
      setup { get '/stylesheets/foo.css' }
      asserts_response_status 200
      asserts_content_type 'text/css'
      asserts_response_body %r[.bar \{\s+display: none; \}\s]
    end

    context "with specified path" do
      setup { get '/css/goo.css' }
      asserts_response_status 200
      asserts_content_type 'text/css'
      asserts_response_body %r[.car \{\s+display: some; \}\s]
    end

    context "with path that's not a defined a sass file" do
      setup { get '/stylesheets/zoo.css' }
      asserts_response_status 404
      asserts_content_type 'text/css'
    end
  end # catching all css

  context "getting obvious views" do
    setup { get '/baz' }
    asserts_response_body "Whatever man. That's just like, your opinion.\n"
  end # getting obvious views

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chicago-0.3.13 test/application_test.rb
chicago-0.3.12 test/application_test.rb
chicago-0.3.11 test/application_test.rb