Sha256: 834bb476bd64ccdec7bcb346a7554d4a491124d54e8417e6f607b0b1bcd40be3

Contents?: true

Size: 872 Bytes

Versions: 20

Compression:

Stored size: 872 Bytes

Contents

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

describe "all_verbs plugin" do 
  it "adds method for each http verb" do
    app(:all_verbs) do |r|
      r.delete{'d'}
      r.head{'h'}
      r.options{'o'}
      r.patch{'pa'}
      r.put{'pu'}
      r.trace{'t'}
      if Rack::Request.method_defined?(:link?)
        r.link{'l'}
        r.unlink{'u'}
      end
    end

    body('REQUEST_METHOD'=>'DELETE').should == 'd'
    body('REQUEST_METHOD'=>'HEAD').should == 'h'
    body('REQUEST_METHOD'=>'OPTIONS').should == 'o'
    body('REQUEST_METHOD'=>'PATCH').should == 'pa'
    body('REQUEST_METHOD'=>'PUT').should == 'pu'
    body('REQUEST_METHOD'=>'TRACE').should == 't'
    if Rack::Request.method_defined?(:link?)
      body('REQUEST_METHOD'=>'LINK').should == 'l'
      body('REQUEST_METHOD'=>'UNLINK').should == 'u'
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
roda-2.2.0 spec/plugin/all_verbs_spec.rb
roda-2.1.0 spec/plugin/all_verbs_spec.rb
roda-2.0.0 spec/plugin/all_verbs_spec.rb
roda-1.3.0 spec/plugin/all_verbs_spec.rb
roda-1.2.0 spec/plugin/all_verbs_spec.rb
roda-1.1.0 spec/plugin/all_verbs_spec.rb
roda-cj-1.0.5 spec/plugin/all_verbs_spec.rb
roda-cj-1.0.4 spec/plugin/all_verbs_spec.rb
roda-cj-1.0.3 spec/plugin/all_verbs_spec.rb
roda-cj-1.0.2 spec/plugin/all_verbs_spec.rb
roda-cj-1.0.1 spec/plugin/all_verbs_spec.rb
roda-cj-1.0.0 spec/plugin/all_verbs_spec.rb
roda-1.0.0 spec/plugin/all_verbs_spec.rb
roda-cj-0.9.6 spec/plugin/all_verbs_spec.rb
roda-cj-0.9.5 spec/plugin/all_verbs_spec.rb
roda-cj-0.9.4 spec/plugin/all_verbs_spec.rb
roda-cj-0.9.3 spec/plugin/all_verbs_spec.rb
roda-cj-0.9.2 spec/plugin/all_verbs_spec.rb
roda-cj-0.9.1 spec/plugin/all_verbs_spec.rb
roda-0.9.0 spec/plugin/all_verbs_spec.rb