Sha256: 94f86cb0def6bb2deab1883a87344749d11c97aa1cde5f33b79207054008f09d
Contents?: true
Size: 941 Bytes
Versions: 2
Compression:
Stored size: 941 Bytes
Contents
require 'rails_helper' RSpec.describe PostsController, type: :routing do describe 'routing' do it 'routes to #index' do expect(get: '/posts').to route_to('posts#index') end it 'routes to #new' do expect(get: '/posts/new').to route_to('posts#new') end it 'routes to #show' do expect(get: '/posts/1').to route_to('posts#show', id: '1') end it 'routes to #edit' do expect(get: '/posts/1/edit').to route_to('posts#edit', id: '1') end it 'routes to #create' do expect(post: '/posts').to route_to('posts#create') end it 'routes to #update via PUT' do expect(put: '/posts/1').to route_to('posts#update', id: '1') end it 'routes to #update via PATCH' do expect(patch: '/posts/1').to route_to('posts#update', id: '1') end it 'routes to #destroy' do expect(delete: '/posts/1').to route_to('posts#destroy', id: '1') end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ecm_tags-2.2.1 | spec/dummy/spec/routing/posts_routing_spec.rb |
ecm_tags-2.2.0 | spec/dummy/spec/routing/posts_routing_spec.rb |