I have the following in my functional test file.

class UserControllerTest < ActionController::TestCase
fixtures :users

  def setup
    @controller = UserController.new
  @request    = ActionController::TestRequest.new
  @response   = ActionController::TestResponse.new
  @invalid_user = user(:invalid_user)
  @valid_user = users(:valid_user)
  end

def test_login_success
  @valid_user.screen_name
end

When I run a test that tries to use the @valid_user variable I get the
following error.

NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.screen_name

It seems that this class isn't storing the instance variables in memory.

Any ideas.

Thanks in advance

Mitch
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to