Sha256: 606dbff85e00ba7080253fba359f1009169cccb0fe16318743427d31028c0a6c

Contents?: true

Size: 741 Bytes

Versions: 2

Compression:

Stored size: 741 Bytes

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'spec/helper'

class TCDispatcherController < Ramaze::Controller
  map '/'

  def index
    "Hello, World!"
  end
end

describe "Dispatcher" do
  before :all do
    ramaze :ignore => ['/favicon.ico', '/robots.txt'],
      :ignore_body => 'File not found'
  end

  it 'should resolve a normal request' do
    page = get('/')
    page.status.should == 200
    page.body.should == 'Hello, World!'
  end

  it 'should ignore /foo.ico' do
    Ramaze::Global.ignore = ['/foo.ico']
    page = get('/foo.ico')
    page.status.should == 404
    page.body.should == 'File not found'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ramaze-0.2.0 spec/ramaze/dispatcher.rb
ramaze-0.2.1 spec/ramaze/dispatcher.rb