Skip to content

Commit f08a24d

Browse files
author
Sebastian Wilgosz
committed
Add routing for fetching article details
1 parent 3638dc0 commit f08a24d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

config/routes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
Rails.application.routes.draw do
44
# get '/articles', to: 'articles#index'
5-
resources :articles, only: [:index]
5+
resources :articles, only: %i[index show]
66
end

spec/routing/articles_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212
)
1313
end
1414
end
15+
16+
it 'routes to articles#show' do
17+
expect(get('/articles/1')).to route_to('articles#show', id: '1')
18+
end
1519
end

0 commit comments

Comments
 (0)