Ok - yes - I’m a desperate newbie and I am not sure why these test don’t
pass.
Here’s the rundown:
the method
def show_space
@space = Space.find(:all, :conditions => [“id=?”, params[:id]])
end
the test
def test_show_space
get :show_space, :id => 1
assert_response :success
assert_template ‘show_space’
assert_not_nil assigns(:space)
assert_equal assigns(:space), spaces(:first_space)
end
and the YAML file: spaces.yml
first_space:
id: 1
title: My first space
subdomain: first-space
domain: functionalalcoholism.org
home_page_id: 57
user_id: 1
owner_id: 1
created_at: 2005-05-21 00:00:00
updated_at: 2005-05-21 00:00:00
wikiwords_enabled: 1
country_code: US
timezone_identifier: US/Eastern
####################################################
the method
def show
@accounts = Account.find (:all, :include => {‘owned_spaces’ =>
:memberships}, :conditions => [“accounts.id=?”, params[:id]])
end
the test
def test_show
get :show,:id => 1
assert_response :success
assert_template ‘show’
assert_equal assigns(:account), accounts(:blake_account)
end
and the YAML file: accounts.yml
blake_account:
id: 1
user_id: 1
first_name: Blake
street: none
expire_on: <%= Date.today + 32 %>
recurring: false
country_code: US