2015-12-16 14:19:58 +00:00
|
|
|
require 'rails_helper'
|
2015-10-12 03:37:44 +00:00
|
|
|
|
2015-12-16 14:19:58 +00:00
|
|
|
RSpec.describe TopicsController, type: :routing do
|
|
|
|
describe 'routing' do
|
|
|
|
it 'routes to #show' do
|
|
|
|
expect(get: '/topics/1').to route_to('topics#show', id: '1')
|
2015-10-12 03:37:44 +00:00
|
|
|
end
|
|
|
|
|
2015-12-16 14:19:58 +00:00
|
|
|
it 'routes to #create' do
|
|
|
|
expect(post: '/topics').to route_to('topics#create')
|
2015-10-12 03:37:44 +00:00
|
|
|
end
|
|
|
|
|
2015-12-16 14:19:58 +00:00
|
|
|
it 'routes to #update via PUT' do
|
|
|
|
expect(put: '/topics/1').to route_to('topics#update', id: '1')
|
2015-10-12 03:37:44 +00:00
|
|
|
end
|
|
|
|
|
2015-12-16 14:19:58 +00:00
|
|
|
it 'routes to #destroy' do
|
|
|
|
expect(delete: '/topics/1').to route_to('topics#destroy', id: '1')
|
2015-10-12 03:37:44 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|