
December 24th, 2006, 02:12 PM
|
|
Contributing User
|
|
Join Date: Mar 2003
Posts: 174
Time spent in forums: 14 h 27 m 11 sec
Reputation Power: 11
|
|
|
Problems developing a test
Hello,
I'm pretty new to ruby and I'm trying to develop a test for a simple
method.
The method is this:
Code:
def show_details
@accounts = Account.find( params[:id] )
end
and the test method I'm trying is this:
Code:
def test_show_details
get :index, :context => 'admin', :id => 1
assert_response :success
assert_equal assigns(:accounts), accounts(:blake_acount)
end
we have some test data in .yml file called accounts.yml which is stored
in /test/fixtures/ directory and it contains this section on
blake_account:
blake_account:
id: 1
user_id: 1
first_name: Blake
expire_on: <%= Date.today + 32 %>
recurring: false
country_code: US
Don't understand why this fails?
|