On 11 July 2011 17:05, Yennie <[email protected]> wrote:
> Hi ,
>
> I want to test the one below but I got the problem
>
>  belongs_to :name, :class_name => "Phrase", :foreign_key => "name"
>
> in my test
> context "test"do
>   should have_many :phrases
> end
>
> in language.rb
>  belongs_to :name, :class_name => "Phrase", :foreign_key => "name"
>
> error is
>
>
>  1) Failure:
> test: check has_many and belongs_to  association should have many
> languages. (PhraseTest) [/usr/local/lib/ruby/gems/1.9.1/gems/
> shoulda-2.11.3/lib/shoulda/context.rb:324]:
> Expected Phrase to have a has_many association called languages
> (Language does not have a phrase_id foreign key.).
> Expected block to return true value.
>
>
> I dont really understand what it's warning now..

It might help us if you showed us the failing test.  Also I think it
would be better to use name_id as the foreign key for language
belongs_to :name.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to