Whilst true I don't think that is the cause of the problem, the error is Error: undefined method `any?' for nil:NilClass from the code if @atp_tournaments.any? so @atp_tournaments is nil rather than the empty array he expects.
Colin
Whilst true I don't think that is the cause of the problem, the error is Error: undefined method `any?' for nil:NilClass from the code if @atp_tournaments.any? so @atp_tournaments is nil rather than the empty array he expects.
Colin
Then the problem was just rendering the home page after invalid submission instead of redirecting to the home page. The original code was render ‘static_pages/home’, you can check it here. This original code would show a flash error message that the test would catch with:
assert_select ‘div#error_explanation’
If I remove or comment this line in the test, the test would pass as long as I use a redirect in the create action of the microposts controller. No flash errors are showed after redirection, though
On 10 February 2017 at 14:29, 'krfg' via Ruby on Rails: Talk
It works, even though it needs some styling. I am really grateful for your help Colin. and this is not the first time you helped me. Many thanks indeed