Sha256: 322ad05d340dc8b1e933178d1762a7f3ac5ffe9a06b01fdc031e1d3e4fc026c2

Contents?: true

Size: 872 Bytes

Versions: 10

Compression:

Stored size: 872 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 MainController < Ramaze::Controller
  engine :None

  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 'http'
  ramaze :view_root => __DIR__(:view)

  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

10 entries across 10 versions & 4 rubygems

Version Path
Pistos-ramaze-2008.12 spec/ramaze/controller/resolve.rb
Pistos-ramaze-2009.01 spec/ramaze/controller/resolve.rb
Pistos-ramaze-2009.02 spec/ramaze/controller/resolve.rb
manveru-ramaze-2008.12 spec/ramaze/controller/resolve.rb
manveru-ramaze-2009.01 spec/ramaze/controller/resolve.rb
ptomato-ramaze-2009.02.1 spec/ramaze/controller/resolve.rb
ptomato-ramaze-2009.02 spec/ramaze/controller/resolve.rb
ramaze-2009.01 spec/ramaze/controller/resolve.rb
ramaze-2009.03 spec/ramaze/controller/resolve.rb
ramaze-2009.02 spec/ramaze/controller/resolve.rb