Permalink
Browse files

route_to delegates to assert_recognizes rather than assert_routing

- aligns better with the matcher name
- eliminates failures on alternate routes to same controllers
- route generation can be spec'd in the context of view specs
- Closes #221.
  • Loading branch information...
1 parent 971bb0b commit b45d0936d77f3e532a08fc1b49f072be05873f94 @dchelimsky dchelimsky committed Oct 6, 2010
Showing with 10 additions and 3 deletions.
  1. +7 −0 History.md
  2. +1 −1 lib/rspec/rails/matchers/routing_matchers.rb
  3. +2 −2 spec/rspec/rails/matchers/route_to_spec.rb
View
@@ -1,5 +1,12 @@
## rspec-rails release history (incomplete)
+### 2.0.0 / in development
+
+[full changelog](http://github.com/rspec/rspec-rails/compare/v2.0.0.rc...master)
+
+* Changes
+ * route_to matcher delegates to assert_recognizes instead of assert_routing
+
### 2.0.0.rc / 2010-10-05
[full changelog](http://github.com/rspec/rspec-rails/compare/v2.0.0.beta.22...v2.0.0.rc)
@@ -5,7 +5,7 @@ module RoutingMatchers
matcher :route_to do |route_options|
match_unless_raises Test::Unit::AssertionFailedError do |path|
assertion_path = { :method => path.keys.first, :path => path.values.first }
- assert_routing(assertion_path, route_options)
+ assert_recognizes(route_options, assertion_path)
end
failure_message_for_should do
@@ -3,8 +3,8 @@
describe "route_to" do
include RSpec::Rails::Matchers::RoutingMatchers
- it "uses failure message from assert_routing" do
- self.stub!(:assert_routing).and_raise(
+ it "uses failure message from assert_recognizes" do
+ self.stub!(:assert_recognizes).and_raise(
Test::Unit::AssertionFailedError.new("this message"))
expect do
{"this" => "path"}.should route_to("these" => "options")

0 comments on commit b45d093

Please sign in to comment.