Sha256: 25b891fc827544f3bc224c5d01b8782e190afbd47a2af2f449952f08ef9feab0

Contents?: true

Size: 669 Bytes

Versions: 24

Compression:

Stored size: 669 Bytes

Contents

require "action_dispatch/testing/assertions/routing"

module RSpec::Rails
  module RoutingExampleGroup
    extend ActiveSupport::Concern
    include RSpec::Rails::RailsExampleGroup
    include ActionDispatch::Assertions::RoutingAssertions
    include RSpec::Rails::Matchers::RoutingMatchers
    include RSpec::Rails::Matchers::RoutingMatchers::RouteHelpers

    included do
      metadata[:type] = :routing

      before do
        @routes = ::Rails.application.routes
      end
    end

    attr_reader :routes

    private

    def method_missing(m, *args, &block)
      routes.url_helpers.respond_to?(m) ? routes.url_helpers.send(m, *args) : super
    end
  end
end

Version data entries

24 entries across 19 versions & 4 rubygems

Version Path
rspec-rails-2.9.0.rc2 lib/rspec/rails/example/routing_example_group.rb
rspec-rails-2.8.1 lib/rspec/rails/example/routing_example_group.rb
rspec-rails-2.8.0 lib/rspec/rails/example/routing_example_group.rb
rspec-rails-2.8.0.rc2 lib/rspec/rails/example/routing_example_group.rb