NameError: uninitialized constant ActiveRecord::FixtureSet::RenderContext::Fixtures

829 views
Skip to first unread message

Colin Law

unread,
Oct 18, 2014, 4:07:32 PM10/18/14
to rubyonra...@googlegroups.com
I hope someone can help me with this one. I have upgraded a simple
app from rails 2.3 to 4.1.6 and got the app going with little
difficulty. However when I run the tests using rake test, for every
test I get
NameError: uninitialized constant
ActiveRecord::FixtureSet::RenderContext::Fixtures

I have a simple 4.1.6 app with tests that work ok and can't see any
obvious difference in the test setup. test_helper.rb is identical and
the settings in environment/test.rb are the same.

Google has failed me. Any suggestions will be gratefully received.

Colin

Colin Law

unread,
Oct 18, 2014, 4:45:31 PM10/18/14
to rubyonra...@googlegroups.com
On 18 October 2014 21:06, Colin Law <cla...@gmail.com> wrote:
> I hope someone can help me with this one. I have upgraded a simple
> app from rails 2.3 to 4.1.6 and got the app going with little
> difficulty. However when I run the tests using rake test, for every
> test I get
> NameError: uninitialized constant
> ActiveRecord::FixtureSet::RenderContext::Fixtures

Why is it that after spending hours looking at a problem, ten minutes
after posting a request for help one finds the answer oneself?

The problem was that in one of the fixtures I was using

<%= Fixtures.identify(:...) %>

this has to be changed to

<%= ActiveRecord::FixtureSet.identify(:...) %>

0 out of 10 to rails for a really helpful error message. Problem
solved however, sorry for the noise. Perhaps this will be useful to
someone else if they get that error. I am still surprised google did
not find any reports of others with the same issue.

Cheers

Colin
Reply all
Reply to author
Forward
0 new messages