# Help! w/ these simple tests!

**URL:** <https://www.ruby-forum.com/t/help-w-these-simple-tests/83942>\
**Category:** Ruby\
**Created:** [January 30, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/help-w-these-simple-tests/83942 "2007-01-30T22:21:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [January 30, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/help-w-these-simple-tests/83942/1 "2007-01-30T22:21:44Z")

</div>

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](http://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

---

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [January 31, 2007, 12:19am UTC](https://www.ruby-forum.com/t/help-w-these-simple-tests/83942/2 "2007-01-31T00:19:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [January 31, 2007, 12:31am UTC](https://www.ruby-forum.com/t/help-w-these-simple-tests/83942/3 "2007-01-31T00:31:11Z")

</div>

On Jan 30, 4:18 pm, Eric H. [removed\_email\_address@domain.invalid](mailto: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-](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.)
