Topic: Why is this nil?

require File.dirname(__FILE__) + '/../test_helper'
require 'user_controller'

class UserController; def rescue_action(e) raise e end; end

class UserControllerTest < ActionController::TestCase
  fixtures :users
 
  def setup
    @controller = UserController.new
    @request = ActionController::TestRequest.new
    @response = ActionController::TestResponse.new
    @valid_user = users(:valid_user)
  end

  def test_fails_for_some_reason
    assert_not_nil @valid_user
  end


@valid_user is nil in test_fails_for_some_reason but if I do this:

user = users(:valid_user)
assert_not_nil user

it works...

how am I screwing this up?

Thanks

Re: Why is this nil?

Are the fixtures run *after* setup?

Toby Hede
===================================================
FiniteStateMachine - Software Development for Social Networks
===================================================

Re: Why is this nil?

I was following an example in a book I bought.  I assumed that "setup" was one of those magical methods that rails called for me before the test fixture.  But I guessing that's not the case...