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.28.0 spec/plugin/all_verbs_spec.rb
roda-3.27.0 spec/plugin/all_verbs_spec.rb
roda-3.26.0 spec/plugin/all_verbs_spec.rb
roda-3.25.0 spec/plugin/all_verbs_spec.rb
roda-3.24.0 spec/plugin/all_verbs_spec.rb
roda-3.23.0 spec/plugin/all_verbs_spec.rb
roda-3.22.0 spec/plugin/all_verbs_spec.rb
roda-3.21.0 spec/plugin/all_verbs_spec.rb
roda-3.20.0 spec/plugin/all_verbs_spec.rb
roda-3.19.0 spec/plugin/all_verbs_spec.rb
roda-3.18.0 spec/plugin/all_verbs_spec.rb
roda-3.17.0 spec/plugin/all_verbs_spec.rb
roda-3.16.0 spec/plugin/all_verbs_spec.rb
roda-3.15.0 spec/plugin/all_verbs_spec.rb
roda-3.14.1 spec/plugin/all_verbs_spec.rb
roda-3.14.0 spec/plugin/all_verbs_spec.rb
roda-3.13.0 spec/plugin/all_verbs_spec.rb
roda-3.12.0 spec/plugin/all_verbs_spec.rb
roda-3.11.0 spec/plugin/all_verbs_spec.rb
roda-3.10.0 spec/plugin/all_verbs_spec.rb