If I have something like <%= link_to "Help", help_path %> in the view file, how do I test the following using rspec?
- It goes to
help_path. - The content reads “Help”.
I am currently using capybara.
edit
While answers below can work, I think I found a simpler way of doing this.
describe "some link on whatever page" do
subject { page }
before { visit whatever_path }
it { should have_link('Help', href: help_path) }
end
If you are using capybara then
But also you could simply add routes specs to your integration specs in rspec. Like this to be always sure this routes exists