Sha256: b58fdac48ba5e1f4cc233dc0448132132b8181f4398e64ddfc54767caed992e2

Contents?: true

Size: 1.3 KB

Versions: 45

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe "QA Routes", type: :routing do
  routes { Qa::Engine.routes }

  context "listing terms" do
    it "routes to index with an authority" do
      expect(get: '/terms/vocab').to route_to(controller: 'qa/terms', action: 'index', vocab: 'vocab')
    end
    it "routes to index with an authority and a subauthority" do
      expect(get: '/terms/vocab/sub').to route_to(controller: 'qa/terms', action: 'index', vocab: 'vocab', subauthority: 'sub')
    end
  end

  context "searching for terms" do
    it "routes to searching for an authority" do
      expect(get: '/search/vocab').to route_to(controller: 'qa/terms', action: 'search', vocab: 'vocab')
    end
    it "routes to searching for an authority and a subauthority" do
      expect(get: '/search/vocab/sub').to route_to(controller: 'qa/terms', action: 'search', vocab: 'vocab', subauthority: 'sub')
    end
  end

  context "displaying a single term" do
    it "routes to an authority" do
      expect(get: '/show/vocab/term_id').to route_to(controller: 'qa/terms', action: 'show', vocab: 'vocab', id: 'term_id')
    end
    it "routes to an authority with a subauthority" do
      expect(get: '/show/vocab/sub/term_id').to route_to(controller: 'qa/terms', action: 'show', vocab: 'vocab', subauthority: 'sub', id: 'term_id')
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
qa-5.14.0 spec/routing/route_spec.rb
qa-5.13.0 spec/routing/route_spec.rb
qa-5.12.0 spec/routing/route_spec.rb
qa-5.11.0 spec/routing/route_spec.rb
qa-5.10.0 spec/routing/route_spec.rb
qa-5.9.0 spec/routing/route_spec.rb
qa-5.8.1 spec/routing/route_spec.rb
qa-5.8.0 spec/routing/route_spec.rb
qa-5.7.0 spec/routing/route_spec.rb
qa-5.6.0 spec/routing/route_spec.rb
qa-5.5.2 spec/routing/route_spec.rb
qa-4.3.0 spec/routing/route_spec.rb
qa-3.1.0 spec/routing/route_spec.rb
qa-2.3.0 spec/routing/route_spec.rb
qa-5.5.1 spec/routing/route_spec.rb
qa-5.5.0 spec/routing/route_spec.rb
qa-5.4.0 spec/routing/route_spec.rb
qa-5.3.1 spec/routing/route_spec.rb
qa-5.3.0 spec/routing/route_spec.rb
qa-5.2.0 spec/routing/route_spec.rb