Hi,

I have two select lists in my app called 'topic' and 'member'.
Based on what I select in topic, member is populated accordingly (using
java script).
eg. If I select 'subject1' in topic, member should be populated with the
values 'prof x', 'prof y' and 'prof z'.
Can I test that my java script function is populating member with the
correct values in a unit test?

So far I have tried:

def test_correct_value_returned
applicant = Applicant.new(valid_attributes(:topic => "", :member =>
"",))
applicant.topic = "subject1"
assert_equal ["prof x", "prof y", "prof z"], applicant.member
end

But I get:
1) Failure:
test_test_correct_value_returned(ApplicantTest)
[/test/unit/applicant_test.rb:2098]:
<["prof x", "prof y", "prof z"]> expected but was
<"">.

Can anyone give me a pointer as to how I could go about getting this to
work?
Thanks very much.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to