Skip to content

Correct return value of path_for #1815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2017

Conversation

hlcfan
Copy link
Contributor

@hlcfan hlcfan commented May 11, 2017

Method ViewPathBuilder#path_for is actually returning correct url or exception error message.

It's nil in the documentation, guess people forgot this when working on #1402. Correcting now.

@hlcfan hlcfan force-pushed the correct-view-path-builder-return-value branch from a751cb5 to d32b51b Compare May 11, 2017 04:43
@JonRowe
Copy link
Member

JonRowe commented May 11, 2017

Is that the correct message? I wouldn't expect it to look like an error...

@hlcfan
Copy link
Contributor Author

hlcfan commented May 11, 2017

@JonRowe

[3] pry(#<RSpec::Rails::ViewPathBuilder>)> path_params
=> {:controller=>"rooms", :action=>"show"}
[4] pry(#<RSpec::Rails::ViewPathBuilder>)> url_for(path_params.merge(:only_path => true))
ActionController::UrlGenerationError: No route matches {:action=>"show", :controller=>"rooms"}
from /Users/thatsme/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/actionpack-5.0.2/lib/action_dispatch/journey/formatter.rb:51:in `generate'

@JonRowe
Copy link
Member

JonRowe commented May 11, 2017

TIL, take out the <,'> and it'll be all good then

@hlcfan hlcfan force-pushed the correct-view-path-builder-return-value branch from d32b51b to 807b8ef Compare May 11, 2017 09:02
@hlcfan
Copy link
Contributor Author

hlcfan commented May 11, 2017

Updated.

@JonRowe JonRowe merged commit 442f6d1 into rspec:master May 13, 2017
@JonRowe
Copy link
Member

JonRowe commented May 13, 2017

Thanks ❤️

@hlcfan hlcfan deleted the correct-view-path-builder-return-value branch May 13, 2017 11:46
sebjacobs pushed a commit to futurelearn/rspec-rails that referenced this pull request Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants