Sha256: 8efd5e94eb951ba536952dea42fd7813d8a66b6f42b245b9e55fbb26c6a890f4

Contents?: true

Size: 845 Bytes

Versions: 6

Compression:

Stored size: 845 Bytes

Contents

module RSpec
  module Rails
    module Matchers
      # Matchers to help with specs for routing code.
      module RoutingMatchers
        class RouteToMatcher
          def matches_with_patches?(verb_to_path_map)
            path = verb_to_path_map.values.first
            verb_to_path_map[verb_to_path_map.keys.first] = "http://#{BACKEND_SUBDOMAIN}.example.com#{path[0] == "/" ? "" : "/"}#{path}";
            matches_without_patches?(verb_to_path_map)
          end
          alias_method_chain :matches?, :patches
        end

        class FrontendRouteToMatcher < RouteToMatcher
          def matches?(verb_to_path_map)
            matches_without_patches?(verb_to_path_map)
          end
        end

        def frontend_route_to(*expected)
          FrontendRouteToMatcher.new(self, *expected)
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
xing-backend-1.0.0.pre.beta lib/xing/spec_helpers/routing_spec_patch.rb
xing-backend-0.0.25 lib/xing/spec_helpers/routing_spec_patch.rb
xing-backend-0.0.23 lib/xing/spec_helpers/routing_spec_patch.rb
xing-backend-0.0.22 lib/xing/spec_helpers/routing_spec_patch.rb
xing-backend-0.0.21 lib/xing/spec_helpers/routing_spec_patch.rb
xing-backend-0.0.20 lib/xing/spec_helpers/routing_spec_patch.rb