|
| 1 | +require 'rails_helper' |
| 2 | + |
| 3 | +RSpec.describe Admin::FormDescriptionsController, type: :routing do |
| 4 | + describe 'routing' do |
| 5 | + it 'routes to #new' do |
| 6 | + expect(get: '/admin/conferences/rk2025/form_descriptions/new').to route_to( |
| 7 | + controller: 'admin/form_descriptions', |
| 8 | + action: 'new', |
| 9 | + conference_slug: 'rk2025' |
| 10 | + ) |
| 11 | + end |
| 12 | + |
| 13 | + it 'routes to #create' do |
| 14 | + expect(post: '/admin/conferences/rk2025/form_descriptions').to route_to( |
| 15 | + controller: 'admin/form_descriptions', |
| 16 | + action: 'create', |
| 17 | + conference_slug: 'rk2025' |
| 18 | + ) |
| 19 | + end |
| 20 | + |
| 21 | + it 'routes to #show using locale parameter' do |
| 22 | + expect(get: '/admin/conferences/rk2025/form_descriptions/en').to route_to( |
| 23 | + controller: 'admin/form_descriptions', |
| 24 | + action: 'show', |
| 25 | + conference_slug: 'rk2025', |
| 26 | + locale: 'en' |
| 27 | + ) |
| 28 | + end |
| 29 | + |
| 30 | + it 'routes to #edit using locale parameter' do |
| 31 | + expect(get: '/admin/conferences/rk2025/form_descriptions/ja/edit').to route_to( |
| 32 | + controller: 'admin/form_descriptions', |
| 33 | + action: 'edit', |
| 34 | + conference_slug: 'rk2025', |
| 35 | + locale: 'ja' |
| 36 | + ) |
| 37 | + end |
| 38 | + |
| 39 | + it 'routes to #update via PUT using locale parameter' do |
| 40 | + expect(put: '/admin/conferences/rk2025/form_descriptions/en').to route_to( |
| 41 | + controller: 'admin/form_descriptions', |
| 42 | + action: 'update', |
| 43 | + conference_slug: 'rk2025', |
| 44 | + locale: 'en' |
| 45 | + ) |
| 46 | + end |
| 47 | + |
| 48 | + it 'routes to #update via PATCH using locale parameter' do |
| 49 | + expect(patch: '/admin/conferences/rk2025/form_descriptions/en').to route_to( |
| 50 | + controller: 'admin/form_descriptions', |
| 51 | + action: 'update', |
| 52 | + conference_slug: 'rk2025', |
| 53 | + locale: 'en' |
| 54 | + ) |
| 55 | + end |
| 56 | + |
| 57 | + it 'routes to #destroy using locale parameter' do |
| 58 | + expect(delete: '/admin/conferences/rk2025/form_descriptions/ja').to route_to( |
| 59 | + controller: 'admin/form_descriptions', |
| 60 | + action: 'destroy', |
| 61 | + conference_slug: 'rk2025', |
| 62 | + locale: 'ja' |
| 63 | + ) |
| 64 | + end |
| 65 | + end |
| 66 | +end |
0 commit comments