Sha256: 3ec296b51752d7f7472c734b3ca49c30baf749182e99200723ffc8dbebadfc67

Contents?: true

Size: 830 Bytes

Versions: 8

Compression:

Stored size: 830 Bytes

Contents

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

require 'spec/helper'

class MainController < Ramaze::Controller
  map '/'

  define_method('file.ext'){ 'file.ext' }
  define_method('css__file.css'){ 'file.css' }
  define_method('path__to__js__file.js'){ 'file.js' }
  define_method('other__greet__other'){ @greet = 'hi' }
end

describe 'Controller resolving' do
  behaves_like :rack_test

  it 'should work with .' do
    get('/file.ext').body.should == 'file.ext'
  end

  it 'should work with /' do
    get('/css/file.css').body.should == 'file.css'
    get('/path/to/js/file.js').body.should == 'file.js'
  end

  it 'should find templates' do
    get('/other/greet/other').body.should == '<html>Other: hi</html>'
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
manveru-ramaze-2009.06.04 spec/ramaze/controller/resolve.rb
manveru-ramaze-2009.06.12 spec/ramaze/controller/resolve.rb
manveru-ramaze-2009.06 spec/ramaze/controller/resolve.rb
rjspotter-ramaze-2009.06.29 spec/ramaze/controller/resolve.rb
rjspotter-ramaze-2009.06.31 spec/ramaze/controller/resolve.rb
ramaze-2009.06 spec/ramaze/controller/resolve.rb
ramaze-2009.06.12 spec/ramaze/controller/resolve.rb
ramaze-2009.06.04 spec/ramaze/controller/resolve.rb