Sha256: 06be36038bce5f5cb04e564fda4287b249a9b09e05e16b54fb410d07df3f1a79

Contents?: true

Size: 896 Bytes

Versions: 13

Compression:

Stored size: 896 Bytes

Contents

require 'spec_helper'

describe Praxis::Route do

  let(:verb) { 'GET' }
  let(:path) { '/base/stuff' }
  let(:prefixed_path) { '/stuff' }
  let(:version) { '1.0' }
  let(:options) { {} }

  subject(:route) { Praxis::Route.new(verb, path, version, prefixed_path: prefixed_path, **options) }

  its(:verb) { should be(verb) }
  its(:path) { should be(path) }
  its(:version) { should be(version) }
  its(:prefixed_path) { should eq(prefixed_path) }
  its(:options) { should eq(options) }

  it 'defaults version to "n/a"' do
    route = Praxis::Route.new(verb, path, **options)
    expect(route.version).to eq('n/a')
  end

  context '#describe' do
    subject(:description) { route.describe }
    it { should eq({verb:verb, path:path , version:version}) }

    context 'with options' do
      let(:options) { {option: 'value'} }
      its([:options]) { should eq(options) }
    end

  end



end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
praxis-2.0.pre.18 spec/praxis/route_spec.rb
praxis-2.0.pre.17 spec/praxis/route_spec.rb
praxis-2.0.pre.16 spec/praxis/route_spec.rb
praxis-2.0.pre.15 spec/praxis/route_spec.rb
praxis-2.0.pre.14 spec/praxis/route_spec.rb
praxis-2.0.pre.13 spec/praxis/route_spec.rb
praxis-2.0.pre.12 spec/praxis/route_spec.rb
praxis-2.0.pre.11 spec/praxis/route_spec.rb
praxis-2.0.pre.10 spec/praxis/route_spec.rb
praxis-2.0.pre.9 spec/praxis/route_spec.rb
praxis-2.0.pre.8 spec/praxis/route_spec.rb
praxis-2.0.pre.7 spec/praxis/route_spec.rb
praxis-2.0.pre.6 spec/praxis/route_spec.rb