mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
17 lines
504 B
Ruby
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
|