I tried testing routes and just copied the example from the rspec-rails documentation.
describe "routing to profiles" do
it "routes /profile/:username to profile#show for username" do
expect(:get => "/profiles/jsmith").to route_to(
:controller => "profiles",
:action => "show",
:username => "jsmith"
)
end
end
I got the following error when running RSpec:
Failures:
1) routing to profiles routes /profile/:username to profile#show for username
Failure/Error: expect(:get => "/profiles/jsmith").to route_to(
ArgumentError:
wrong number of arguments (1 for 0)
# ./spec/routing/test_spec.rb:11:in `block (2 levels) in <top (required)>'
Finished in 0.001 seconds
1 example, 1 failure
What's going wrong here?
Thanks for any help.