# Beginner needs help

**URL:** <https://www.ruby-forum.com/t/beginner-needs-help/171444>\
**Category:** Rails\
**Created:** [July 2, 2009, 2:56pm UTC](https://www.ruby-forum.com/t/beginner-needs-help/171444 "2009-07-02T14:56:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [July 2, 2009, 2:56pm UTC](https://www.ruby-forum.com/t/beginner-needs-help/171444/1 "2009-07-02T14:56:08Z")

</div>

Hi, I am trying to follow the book ‘Beginning Ruby on Rails e-commerce’  
examples.

When I come to unit testing I get an error message:  
C:/Ruby/bin/ruby.exe -I"lib;test"  
“C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake\_test\_loader.rb”  
“test/unit/author\_test.rb” “test/unit/helpers/about\_helper\_test.rb”  
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active\_support/dependencies.rb:440:in  
`load\_missing\_constant’: uninitialized constant Test::Unit::Testcase  
(NameError)

My test/unit/author\_test.rb looks like this:

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

class AuthorTest \< Test::Unit::Testcase  
fixtures :authors  
def test\_name  
author=Author.create(:first\_name =\> ‘Joel’,  
:last\_name =\> ‘Spolsky’)

```
assert_equal 'Joel Spolsky', author.name

```

end  
end

Why do I get the error message ?

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [July 2, 2009, 7:39pm UTC](https://www.ruby-forum.com/t/beginner-needs-help/171444/2 "2009-07-02T19:39:50Z")

</div>

What version of Rails are you using?

On Jul 2, 1:56 pm, Peter H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [July 3, 2009, 8:54am UTC](https://www.ruby-forum.com/t/beginner-needs-help/171444/3 "2009-07-03T08:54:22Z")

</div>

> class AuthorTest \< Test::Unit::Testcase

change the above to

class AuthorTest \< ActiveSupport::TestCase

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [July 2, 2009, 8:52pm UTC](https://www.ruby-forum.com/t/beginner-needs-help/171444/4 "2009-07-02T20:52:06Z")

</div>

He’s using 2.3.2 from the errors…

So, did you create everything from scratch? Or, did you read a section  
in the book that said go to x website and download the incomplete or  
complete samples and you are working from those?

If you are working from samples, the samples are probably not using the  
same RoR version you are. That’s the very first question I’d answer.

Most books and source files that go with those books are out of date  
already.

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [July 3, 2009, 8:54am UTC](https://www.ruby-forum.com/t/beginner-needs-help/171444/5 "2009-07-03T08:54:27Z")

</div>

> class AuthorTest \< Test::Unit::Testcase

change the above to

class AuthorTest \< ActiveSupport::TestCase

Sijo

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [July 4, 2009, 8:12pm UTC](https://www.ruby-forum.com/t/beginner-needs-help/171444/6 "2009-07-04T20:12:07Z")

</div>

Thanks guys,  
I have been out of town a few days, thats why this late reply.

I am using Rails 2.3.2 The book was published in 2006 so I guess the  
examples can be out of date. I ran into that when the book mentioned  
start-form-tag and end-form-tag… Took me a while to figure that out.

Anyways, I am buildng all the examples from scratch, and so far I have  
not downloaded anything, so it could be a typo, even though I have  
checked the code several times…

Tha last two suggestions I haven’t tried yet, but I will.

cheers,

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [July 4, 2009, 8:19pm UTC](https://www.ruby-forum.com/t/beginner-needs-help/171444/7 "2009-07-04T20:19:34Z")

</div>

Tried the suggestions from Sijo. Worked like a charm. Coool…!

Thanks again everyone!

//Peter
