summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-02-20 19:27:53 -0700
committermo khan <mo@mokhan.ca>2014-02-20 19:27:53 -0700
commit12e544beb49702b876ce0cbd104d881d86b53383 (patch)
treec508e77be53004038df22c71fdcb95bbb33490ff
parenteed61ce1f9ea921b9bc9dabd468ea7683e5b4622 (diff)
add route to licenses#show.
-rw-r--r--config/routes.rb2
-rw-r--r--spec/routing/licenses_routing_spec.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 87a889f..a9b6923 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,5 +1,5 @@
CodeChallengeMo::Application.routes.draw do
namespace :v1, path: 'v1' do
- get 'licenses', to: 'licenses#index'
+ resources :licenses, only: [:index, :show]
end
end
diff --git a/spec/routing/licenses_routing_spec.rb b/spec/routing/licenses_routing_spec.rb
index bc2d45d..4491c5b 100644
--- a/spec/routing/licenses_routing_spec.rb
+++ b/spec/routing/licenses_routing_spec.rb
@@ -4,4 +4,9 @@ describe 'v1/licenses' do
it "can route to the index action" do
expect({ get: 'v1/licenses' }).to route_to(controller: 'v1/licenses', action: 'index')
end
+
+ it "can route to the show action" do
+ uuid = 'aa80f0ee-c6da-4b1d-bd80-3c50c93d083e'
+ expect(get: "v1/licenses/#{uuid}").to route_to(controller: 'v1/licenses', action: 'show', id: uuid)
+ end
end