Sha256: 04f51472f0344498f29ec350dc6cb5af2385b1426bc3ef09c3e97cddae8a7dc8

Contents?: true

Size: 869 Bytes

Versions: 5

Compression:

Stored size: 869 Bytes

Contents

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

require File.expand_path('../../../../spec/helper', __FILE__)

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

5 entries across 5 versions & 1 rubygems

Version Path
ramaze-2023.01.06 spec/ramaze/controller/resolve.rb
ramaze-2012.12.08 spec/ramaze/controller/resolve.rb
ramaze-2012.12.08b spec/ramaze/controller/resolve.rb
ramaze-2012.04.14 spec/ramaze/controller/resolve.rb
ramaze-2012.03.07 spec/ramaze/controller/resolve.rb