Sha256: af350c23c80afb2e37058c4982dfa0869a672da29996cf794a7746d2b3f8d41b

Contents?: true

Size: 1.29 KB

Versions: 12

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

RSpec.describe MessagesController, type: :routing do
  describe '#index' do
    it 'matches the messages_path' do
      expect(messages_path).to eq '/messages'
    end

    it 'routes to #index' do
      expect(get: '/messages').to route_to 'messages#index'
    end
  end

  describe '#create' do
    it 'matches the create_message_path' do
      expect(create_message_path).to eq '/messages/create'
    end

    it 'routes to #create' do
      expect(get: '/messages/create').to route_to 'messages#create'
    end
  end

  describe '#show' do
    it 'matches the message_path' do
      expect(message_path('1')).to eq '/messages/1'
    end

    it 'routes to #show' do
      expect(get: '/messages/1').to route_to 'messages#show', id: '1'
    end
  end

  describe '#destroy' do
    it 'matches the destroy_message_path' do
      expect(destroy_message_path('1')).to eq '/messages/1/destroy'
    end

    it 'routes to #destroy' do
      expect(get: '/messages/1/destroy').to route_to 'messages#destroy', id: '1'
    end
  end

  describe '#update' do
    it 'matches the update_message_path' do
      expect(update_message_path('1')).to eq '/messages/1/update'
    end

    it 'routes to #update' do
      expect(get: '/messages/1/update').to route_to 'messages#update', id: '1'
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
entangled-0.0.18 spec/routing/messages_routing_spec.rb
entangled-0.0.17 spec/routing/messages_routing_spec.rb
entangled-0.0.16 spec/routing/messages_routing_spec.rb
entangled-0.0.15 spec/routing/messages_routing_spec.rb
entangled-0.0.14 spec/routing/messages_routing_spec.rb
entangled-0.0.13 spec/routing/messages_routing_spec.rb
entangled-0.0.12 spec/routing/messages_routing_spec.rb
entangled-0.0.11 spec/routing/messages_routing_spec.rb
entangled-0.0.10 spec/routing/messages_routing_spec.rb
entangled-0.0.9 spec/routing/messages_routing_spec.rb
entangled-0.0.8 spec/routing/messages_routing_spec.rb
entangled-0.0.7 spec/routing/messages_routing_spec.rb