Sha256: 3614cad98891095f4186f24f5d4ff3aee8d144b4e8241e4ddae4387732aff8c9

Contents?: true

Size: 548 Bytes

Versions: 7

Compression:

Stored size: 548 Bytes

Contents

require 'spec_helper'

describe 'Parameter Transformations' do
  describe 'default' do
    it 'sets a default value when none is given' do
      get('/default') do |response|
        response.status.should == 200
        JSON.parse(response.body)['sort'].should == 'title'
      end
    end
  end

  describe 'transform' do
    it 'transforms the input using to_proc' do
      get('/transform', order: 'asc') do |response|
        response.status.should == 200
        JSON.parse(response.body)['order'].should == 'ASC'
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sinatra-param-1.1.0 spec/parameter_transformations_spec.rb
sinatra-param-1.0.3 spec/parameter_transformations_spec.rb
sinatra-param-1.0.2 spec/parameter_transformations_spec.rb
sinatra-param-1.0.1 spec/parameter_transformations_spec.rb
sinatra-param-1.0.0 spec/parameter_transformations_spec.rb
sinatra-param-0.1.3 spec/parameter_transformations_spec.rb
sinatra-param-0.1.2 spec/parameter_transformations_spec.rb