Forum: Ruby on Rails Problem Referencing Fixture Objects

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
80b3b3a2e46cc1418f92497a1e8f84ae?d=identicon&s=25 Robert Jones (Guest)
on 2006-02-24 17:02
(Received via mailing list)
In my tests, I use fixtures, eg pupils.yml might be:

jimmy:
  id: 100003
  known_as: Jimmy
  surname: Page
  academic_year_id: 1
  gender: m

In the test, @jimmy (the referencing style referred to in Agile Web
Dev....)
is nil, whereas pupil(:jimmy) returns the expected Pupil object.

What gives?

Robert
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-02-24 17:11
(Received via mailing list)
Robert Jones wrote:
> is nil, whereas pupil(:jimmy) returns the expected Pupil object.
>
> What gives?
>
A change in syntax between the book's publication and Rails 1.0.  You
can turn the ols style back on, but unless you've got old, failing
tests, there's really not much reason.
80b3b3a2e46cc1418f92497a1e8f84ae?d=identicon&s=25 Robert Jones (Guest)
on 2006-02-24 17:33
(Received via mailing list)
Alex Young wrote:

>> In the test, @jimmy (the referencing style referred to in Agile Web
>> Dev....) is nil, whereas pupil(:jimmy) returns the expected Pupil object.
>>
>> What gives?
>>
> A change in syntax between the book's publication and Rails 1.0.  You
> can turn the ols style back on, but unless you've got old, failing
> tests, there's really not much reason.
>

Thanks - I thought I was going nuts!

Robert
This topic is locked and can not be replied to.