Sha256: fd469a0ddab16c46f02e8229805fe8780852cc62aecbaffa1070e116f9951771

Contents?: true

Size: 836 Bytes

Versions: 30

Compression:

Stored size: 836 Bytes

Contents

require_relative "../spec_helper"

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').must_equal 'd'
    body('REQUEST_METHOD'=>'HEAD').must_equal 'h'
    body('REQUEST_METHOD'=>'OPTIONS').must_equal 'o'
    body('REQUEST_METHOD'=>'PATCH').must_equal 'pa'
    body('REQUEST_METHOD'=>'PUT').must_equal 'pu'
    body('REQUEST_METHOD'=>'TRACE').must_equal 't'
    if Rack::Request.method_defined?(:link?)
      body('REQUEST_METHOD'=>'LINK').must_equal 'l'
      body('REQUEST_METHOD'=>'UNLINK').must_equal 'u'
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
roda-3.9.0 spec/plugin/all_verbs_spec.rb
roda-3.8.0 spec/plugin/all_verbs_spec.rb
roda-3.7.0 spec/plugin/all_verbs_spec.rb
roda-3.6.0 spec/plugin/all_verbs_spec.rb
roda-3.5.0 spec/plugin/all_verbs_spec.rb
roda-3.4.0 spec/plugin/all_verbs_spec.rb
roda-3.3.0 spec/plugin/all_verbs_spec.rb
roda-3.2.0 spec/plugin/all_verbs_spec.rb
roda-3.1.0 spec/plugin/all_verbs_spec.rb
roda-3.0.0 spec/plugin/all_verbs_spec.rb