Ruby on Rails Friday, February 10, 2017

On 10 February 2017 at 14:19, Hassan Schroeder
<hassan.schroeder@gmail.com> wrote:
> On Fri, Feb 10, 2017 at 3:02 AM, 'krfg' via Ruby on Rails: Talk
> <rubyonrails-talk@googlegroups.com> wrote:
>
>> The AtpCalendar and WtaCalendar fixtures are empty.
>> Therefore, any? should return an empty array
>
> 1. If your test depends on some values being populated, then you
> need to provide that through fixtures or factories.
>
> 2. Read the doc for Enum - "any?" returns a boolean, not an array.

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvCpgzQS%3DQtEFazLT5G7cX88Vc2Jkq1d28HPmy1dqsRDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment