SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simply rails 2 help please! Test is failing. Chapter 9

    Hi,

    My tests are failing, and I've double checked the code archive and I can't find the fault. Please help.

    I'm on Chapter 9 page 347 and I'm supposed to run the final test and it should work, but I went wrong somewhere. This is the error the console gives me...

    Code:
    ...........................F....
    Finished in 1.484 seconds.
    
      1) Failure:
    test_should_show_user(UsersControllerTest) [/test/functional/users_controller_test.rb:6]:
    Expected response to be a <:succes>, but was <200>
    
    32 tests, 71 assertions, 1 failures, 0 errors
    D:/InstantRails/ruby/bin/ruby.exe -I"lib;test" "D:/InstantRails/ruby/lib/ruby/ge
    ms/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb"
    Errors running test:functionals!
    This is what my users_controller_test looks like...(okey, it's only the one that failed, not the whole file)

    Code:
    class UsersControllerTest < ActionController::TestCase
      def test_should_show_user
        get :show, :id => users(:mj)
    	assert_response :succes
    	assert_template 'show'
    	assert_equal users(:mj), assigns(:user)
      end
    This is my users.yml file...

    Code:
    mj:
      login: mj
      password: sekrit
      name: MJ Meyer
      email: "This is blank to avoid spam from forums as I used my actual email addy"
    
    john:
      login: john
      password: gh752px
      name: John Doe
      email: john@doe.com
    I'm not sure what other files I could/should provide. Please advise if there are any other files wherein the problem could be occurring.

    I also checked my controller files as well as my show files to make sure the code is correct. I could not find any differences.

    Please help!

  2. #2
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah f***... Sorry... This was an ID10T error!! LOL!


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •