Sha256: 7d9a898b9fff021ee8dabe296ecc84af26bfbb8d13853614e59620b93a95a13b

Contents?: true

Size: 1.05 KB

Versions: 29

Compression:

Stored size: 1.05 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/helper')

describe "Routing" do
  it 'should perform restul routing' do
    mock_app do
      controller :parent => :parents do
        get :index, :with => :asset_id do
          "#{url_for(:index, params[:parent_id], :asset_id => params[:asset_id])} get"
        end

        put :index, :with => :asset_id do
          "#{url_for(:index, params[:parent_id], :asset_id => params[:asset_id])} put"
        end

        post :index, :with => :asset_id do
          "#{url_for(:index, :parent_id => params[:parent_id], :asset_id => params[:asset_id])} post"
        end

        delete :index, :with => :asset_id do
          "#{url_for(:index, params[:parent_id], :asset_id => params[:asset_id])} delete"
        end
      end
    end
    get "/parents/1/hi"
    assert_equal "/parents/1/hi get", body
    put "/parents/1/hi"
    assert_equal "/parents/1/hi put", body
    post "/parents/1/hi"
    assert_equal "/parents/1/hi post", body
    delete "/parents/1/hi"
    assert_equal "/parents/1/hi delete", body
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
padrino-core-0.16.0.pre3 test/test_restful_routing.rb
padrino-core-0.16.0.pre2 test/test_restful_routing.rb
padrino-core-0.15.3 test/test_restful_routing.rb
padrino-core-0.15.2 test/test_restful_routing.rb
padrino-core-0.15.1 test/test_restful_routing.rb
padrino-core-0.15.0 test/test_restful_routing.rb
padrino-core-0.14.4 test/test_restful_routing.rb
padrino-core-0.14.3 test/test_restful_routing.rb
padrino-core-0.14.2 test/test_restful_routing.rb
padrino-core-0.13.3.4 test/test_restful_routing.rb
padrino-core-0.14.1.1 test/test_restful_routing.rb
padrino-core-0.14.1 test/test_restful_routing.rb
padrino-core-0.14.0.2 test/test_restful_routing.rb
padrino-core-0.14.0.1 test/test_restful_routing.rb
padrino-core-0.14.0 test/test_restful_routing.rb
padrino-core-0.14.0.rc2 test/test_restful_routing.rb
padrino-core-0.14.0.rc1 test/test_restful_routing.rb
padrino-core-0.13.3.3 test/test_restful_routing.rb
padrino-core-0.13.3.2 test/test_restful_routing.rb
padrino-core-0.13.3.1 test/test_restful_routing.rb