# Help with test Rspec

**URL:** <https://www.ruby-forum.com/t/help-with-test-rspec/194117>\
**Category:** Rails\
**Created:** [August 30, 2010, 5:51pm UTC](https://www.ruby-forum.com/t/help-with-test-rspec/194117 "2010-08-30T17:51:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![learningruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6bbea6/32.png) [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Post date:** [August 30, 2010, 5:51pm UTC](https://www.ruby-forum.com/t/help-with-test-rspec/194117/1 "2010-08-30T17:51:29Z")

</div>

There is a model with the Category fields parent\_id and name\_category.  
Golf name\_category should consist of two words separated by spaces, each  
of which begins with a capital letter, such as “Ruby On Rails”.  
There’s also a selector Category.by\_parent\_id (id).

How can this problem to write tests?

---

<div class="post-metadata">

**Author:** ![learningruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6bbea6/32.png) [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Post date:** [August 30, 2010, 6:20pm UTC](https://www.ruby-forum.com/t/help-with-test-rspec/194117/2 "2010-08-30T18:20:00Z")

</div>

Ruby U. Ruby U. wrote:

> There is a model with the Category fields parent\_id and name\_category.  
> Golf name\_category should consist of two words separated by spaces, each  
> of which begins with a capital letter, such as “Ruby On Rails”.

That’s three words, not two.

> There’s also a selector Category.by\_parent\_id (id).
> 
> How can this problem to write tests?

What are you trying to test for? What’s your question or problem?

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![learningruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6bbea6/32.png) [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Post date:** [August 30, 2010, 7:30pm UTC](https://www.ruby-forum.com/t/help-with-test-rspec/194117/3 "2010-08-30T19:30:32Z")

</div>

That’s three words, not two.  
You mean the check is in the additional words, it is considered a space  
word?  
Ð¡an give an example that you have in mind?

---

<div class="post-metadata">

**Author:** ![learningruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6bbea6/32.png) [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Post date:** [August 30, 2010, 7:32pm UTC](https://www.ruby-forum.com/t/help-with-test-rspec/194117/4 "2010-08-30T19:32:26Z")

</div>

[Please quote when replying – it makes the discussion easier to  
follow.]

Ruby U. Ruby U. wrote:

> That’s three words, not two.  
> You mean the check is in the additional words, it is considered a space  
> word?  
> Ð¡an give an example that you have in mind?

I don’t understand a word of what you wrote here. Please try again.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![learningruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6bbea6/32.png) [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Post date:** [August 30, 2010, 7:59pm UTC](https://www.ruby-forum.com/t/help-with-test-rspec/194117/5 "2010-08-30T19:59:51Z")

</div>

On 30 August 2010 18:37, Ruby U. Ruby U. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> That’s three words, not two. I do not understand what you mean, please  
> explain.  
> Give an example, please.

Please quote appropriately - I can’t easily tell where your comments  
start, and what they relate to (especially when you write _exactly_  
the same as the previous poster!)

Bear in mind: this is read by many people as email from the Google  
mailing list, not on “[ruby-forum.com](http://ruby-forum.com)”, so we can’t just “look up the  
page” to see what previous posts were.

Ruby U. Ruby U. wrote:

> Golf name\_category should consist of two words separated by spaces, each  
> of which begins with a capital letter, such as “Ruby On Rails”.

I think the point was, that your example of a “TWO words separated by  
spaces” consisted of THREE words:

word 1: “Ruby”  
word 2: “on”  
word 3: “Rails”

Do you see?  
So if you would like to clarify your question, people may be able to  
help.

Regards,

PS It’s appreciated (by some) that English is not everyone’s first  
language (or maybe even second or third), so elementary grammatical  
errors can be overlooked, but confusions that do significantly change  
the meaning of a question or the direction an answer may need to go in  
do need to be clarified.

---

<div class="post-metadata">

**Author:** ![learningruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/6bbea6/32.png) [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Post date:** [August 30, 2010, 7:37pm UTC](https://www.ruby-forum.com/t/help-with-test-rspec/194117/6 "2010-08-30T19:37:36Z")

</div>

That’s three words, not two. I do not understand what you mean, please  
explain.  
Give an example, please.
