Sha256: e5b0204232fa1337f79ba3f46e995ff94ea05240c2977c69544f18e7919950e7

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

# encoding: utf-8
require "spec_helper"

module Okei
  describe "units" do

    routes { Okei::Engine.routes }

    let(:root) { "api/v1/units" }

    describe "#index" do

      let(:action) do
        { controller: "okei/#{ root }", action: "index" }
      end

      subject(:request) { { get: "/#{ root }" } }

      it "is routable in json" do
        expect(request).to route_to action.merge(format: "json")
      end
    end

    describe "#show" do

      let(:action) do
        {
          controller: "okei/#{ root }",
          action: "show",
          uuid: "f5f944e1-66c1-4432-82bb-5f8235dcd5d7"
        }
      end

      subject(:request) do
        { get: "/#{ root }/f5f944e1-66c1-4432-82bb-5f8235dcd5d7" }
      end

      it "is routable in json" do
        expect(request).to route_to action.merge(format: "json")
      end
    end

    describe "#find" do

      let(:action) do
        { controller: "okei/#{ root }", action: "search" }
      end

      subject(:request) { { get: "/#{ root }/search" } }

      it "is routable in json" do
        expect(request).to route_to action.merge(format: "json")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
okei-1.0.2 spec/routing/okei/api/v1/units_routing_spec.rb
okei-1.0.1 spec/routing/okei/api/v1/units_routing_spec.rb
okei-1.0.0 spec/routing/okei/api/v1/units_routing_spec.rb
okei-1.0.0.pre.rc spec/routing/okei/api/v1/units_routing_spec.rb
okei-0.0.2 spec/routing/okei/api/v1/units_routing_spec.rb