Files
astuto/spec/routing/post_routing_spec.rb
2019-09-04 17:37:08 +02:00

17 lines
504 B
Ruby

require 'rails_helper'
RSpec.describe 'posts routing', :aggregate_failures, type: :routing do
it 'routes posts' do
expect(get: '/posts').to route_to(
controller: 'posts', action: 'index'
)
expect(post: '/posts').to route_to(
controller: 'posts', action: 'create'
)
expect(get: '/posts/1').not_to be_routable
expect(get: '/posts/1/edit').not_to be_routable
expect(patch: '/posts/1').not_to be_routable
expect(delete: '/posts/1').not_to be_routable
end
end