From: James Hunt Date: 2007-09-10T06:01:38+09:00 Subject: Re: how to fix assigns(:user) on controller test On 9/9/07, OnRails Ruby wrote: > James Hunt wrote: > > Are you using fixtures for your tests? (I assume you are, from the > > assigns() usage). > > > > Can you post the fixtures? > > > the fixtures file is: > user1: > id: 1 > login: testuser1 > user_name:asb > password: 123 > created_at: 2006-04-12 14:30:25 > user2: > id: 2 > login: testuser2 > user_name:asb123 > password: 123 > created_at: 2006-04-12 14:30:25 Therein lies your problem. You don't have a data item in your fixture'd database called 'user', only 'user1' and 'user2' Try assert_equal 'newpassword', assigns(:user1).password -- James