mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
Add tests of controllers
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'board routing', :aggregate_failures, type: :routing do
|
||||
it 'only routes the page to show a board' do
|
||||
RSpec.describe 'boards routing', :aggregate_failures, type: :routing do
|
||||
it 'routes boards' do
|
||||
expect(get: '/boards/1').to route_to(
|
||||
controller: 'boards', action: 'show', id: '1'
|
||||
)
|
||||
17
spec/routing/post_routing_spec.rb
Normal file
17
spec/routing/post_routing_spec.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
Reference in New Issue
Block a user