Sha256: 71ace4bff0d903dc4f6d72865e63a46f8ff06dfafbed2cc3ccb12522aaa6506f

Contents?: true

Size: 442 Bytes

Versions: 2

Compression:

Stored size: 442 Bytes

Contents

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

describe "Sinatra::Test" do
  it "support nested parameters" do
    mock_app {
      get '/' do
        params[:post][:title]
      end

      post '/' do
        params[:post][:content]
      end
    }

    get '/', :post => { :title => 'My Post Title' }
    assert_equal 'My Post Title', body

    post '/', :post => { :content => 'Post Content' }
    assert_equal 'Post Content', body
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
bmizerany-sinatra-0.9.0.5 test/test_test.rb
sinatra-sinatra-0.9.0.5 test/test_test.rb