Sha256: e28794ca0b0eef6305e670e754539d28219ffcf429c1e69492c7d563bcec8705

Contents?: true

Size: 765 Bytes

Versions: 10

Compression:

Stored size: 765 Bytes

Contents

describe "citations routes", type: :routing do
  routes { Hyrax::Engine.routes }

  context "for works" do
    it 'routes to the controller' do
      expect(get: '/works/7/citation').to route_to(controller: 'hyrax/citations', action: 'work', id: '7')
    end
    it 'builds a url' do
      expect(url_for(controller: 'hyrax/citations', action: 'work', id: '7', only_path: true)).to eql('/works/7/citation')
    end
  end

  context "for files" do
    it 'routes to the controller' do
      expect(get: '/files/7/citation').to route_to(controller: 'hyrax/citations', action: 'file', id: '7')
    end
    it 'builds a url' do
      expect(url_for(controller: 'hyrax/citations', action: 'file', id: '7', only_path: true)).to eql('/files/7/citation')
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 spec/routing/citations_route_spec.rb
hyrax-1.1.0 spec/routing/citations_route_spec.rb
hyrax-1.0.5 spec/routing/citations_route_spec.rb
hyrax-1.0.4 spec/routing/citations_route_spec.rb
hyrax-1.0.3 spec/routing/citations_route_spec.rb
hyrax-1.0.2 spec/routing/citations_route_spec.rb
hyrax-1.0.1 spec/routing/citations_route_spec.rb
hyrax-1.0.0.rc2 spec/routing/citations_route_spec.rb
hyrax-1.0.0.rc1 spec/routing/citations_route_spec.rb
test_hyrax-0.0.1.alpha spec/routing/citations_route_spec.rb