I am trying to test my views with RSpec. The particular view that is causing me troubles changes its appearance depending on a url parameter:
link_to \"sort>
That's because you shouldn't be using params
in your views.
The best way I see it to use an helper.
Sorted by <%= sorted_by %>
And in one of your helper files
def sorted_by
params[:sorted_by].capitalize
end
Then you can test your helpers quite easily (because in helpers tests, you can define the params
request.