Help! w/ these simple tests!


#1

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


#2

On Jan 30, 2007, at 13:21, Clem R. wrote:

Ok - yes - I’m a desperate newbie and I am not sure why these test
don’t
pass.

These all look like Rails functional tests, so I think you want the
Rails mailing list.


#3

On Jan 30, 4:18 pm, Eric H. removed_email_address@domain.invalid wrote:

On Jan 30, 2007, at 13:21, Clem R. wrote:

Ok - yes - I’m a desperate newbie and I am not sure why these test
don’t
pass.

These all look like Rails functional tests, so I think you want the
Rails mailing list.

…which can be found at: http://groups.google.com/group/rubyonrails-
talk

(I’d encourage those who helpfully point people in the right direction
to, time permitting, more helpfully aim their pointing finger at a
specific target.)