# Undefined method 'fixtures' for UserTest:Class (NoMethodError)

**URL:** <https://www.ruby-forum.com/t/undefined-method-fixtures-for-usertest-class-nomethoderror/168223>\
**Category:** Rails\
**Created:** [May 18, 2009, 2:55pm UTC](https://www.ruby-forum.com/t/undefined-method-fixtures-for-usertest-class-nomethoderror/168223 "2009-05-18T14:55:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 18, 2009, 2:55pm UTC](https://www.ruby-forum.com/t/undefined-method-fixtures-for-usertest-class-nomethoderror/168223/1 "2009-05-18T14:55:10Z")

</div>

Hi,  
I’m a noob trying to work through adding restful\_authentication to  
a blog. The login page allows me to login and I can create a post  
after loggin in…but my rake:test units won’t run because I’m getting  
an undefined method ‘fixtures’ for UserTest:Class (NoMethodError) I’m  
getting an error on ‘fixtures: users’

==\>I did move include AuthenticatedTestHelper in test/test\_helper.rb  
as per the instructions and commented it out in this class

here’s a bigger snip of my user\_test.rb------

require File.dirname( **FILE** ) + ‘/…/test\_helper’

class UserTest \< Test::Unit::TestCase

# Be sure to include AuthenticatedTestHelper in test/test\_helper.rb

instead.

# Then, you can remove it from this and the functional test.

# include AuthenticatedTestHelper

fixtures :users  
…

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 18, 2009, 3:06pm UTC](https://www.ruby-forum.com/t/undefined-method-fixtures-for-usertest-class-nomethoderror/168223/2 "2009-05-18T15:06:26Z")

</div>

On May 18, 7:54 am, “removed\_email\_address@domain.invalid”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> here’s a bigger snip of my user\_test.rb------
> 
> require File.dirname( **FILE** ) + ‘/…/test\_helper’
> 
> class UserTest \< Test::Unit::TestCase
> 
> # Be sure to include AuthenticatedTestHelper in test/test\_helper.rb
> 
> instead.
> 
> # Then, you can remove it from this and the functional test.
> 
> # include AuthenticatedTestHelper
> 
> fixtures :users  
> …

Aaahhhhhhh =\> No wonder my forehead is flat from slapping it! Of  
course all I had to do was comment out the fixtures :users line to get  
my unit tests to run. Sorry for wasting everyone’s time! --Wayne
