Sha256: 1160e79793e7d3a7cf1f0786e33feda0e8fda379a48e806e185b2c85511182f7

Contents?: true

Size: 1.3 KB

Versions: 12

Compression:

Stored size: 1.3 KB

Contents

require File.join(File.dirname(__FILE__), "..", "spec_helper")

describe "When recognizing requests," do
  
  it "should retain previously set params" do
    Merb::Router.prepare do
      with(:controller => "hellos") do
        identify :id do
          match("/:world").register
        end
      end
    end
    
    route_for("/worlds").should have_route(:controller => "hellos", :world => "worlds")
  end
  
  it "should retain previously set options" do
    Merb::Router.prepare do
     options(:controller_prefix => "hello") do
        identify :id do
          match("/").to(:controller => "world")
        end
      end
    end
    
    route_for("/").should have_route(:controller => "hello/world")
  end
  
  it "should retain previously set namespaces" do
    Merb::Router.prepare do
      namespace :admin do
        identify :id do
          match("/hello").to(:controller => "world")
        end
      end
    end
    
    route_for("/admin/hello").should have_route(:controller => "admin/world")
  end
  
  it "should retain previously set defaults" do
    Merb::Router.prepare do
      defaults(:foo => "bar") do
        identify :id do
          match("/(:foo)").to(:controller => "hello")
        end
      end
    end
    
    route_for("/").should have_route(:controller => "hello", :foo => "bar")
  end
  
end

Version data entries

12 entries across 6 versions & 1 rubygems

Version Path
merb-core-1.1.3 spec/public/router/recognition/identify_spec.rb
merb-core-1.1.3 spec10/public/router/recognition/identify_spec.rb
merb-core-1.1.2 spec10/public/router/recognition/identify_spec.rb
merb-core-1.1.2 spec/public/router/recognition/identify_spec.rb
merb-core-1.1.1 spec/public/router/recognition/identify_spec.rb
merb-core-1.1.1 spec10/public/router/recognition/identify_spec.rb
merb-core-1.1.0 spec10/public/router/recognition/identify_spec.rb
merb-core-1.1.0 spec/public/router/recognition/identify_spec.rb
merb-core-1.1.0.rc1 spec10/public/router/recognition/identify_spec.rb
merb-core-1.1.0.rc1 spec/public/router/recognition/identify_spec.rb
merb-core-1.1.0.pre spec/public/router/recognition/identify_spec.rb
merb-core-1.1.0.pre spec10/public/router/recognition/identify_spec.rb