I''ll answer my own question in case someone else out there is as much
of
a moron as me and could use it to help them...
assert_select "div#div_nick_name", "foo"
Notice the comma...
Bryan Noll wrote:> I''m sure this is user error, so let me describe it real quick.
>
> So, I''m in a functional test, and this line exists in the body of
the
> response:
>
> <div id="div_nick_name"
class=''nav_item''>foo</div>
>
>
> I''m attempting to do this in the test:
>
> assert_select "div#div_nick_name"
> assert_select "div#div_nick_name" "foo"
>
> My intent in case it''s not obvious is to test that the content of
the
> div is equal to ''foo''. The first of those two lines
works, the second
> results in:
>
> ############################
> 1) Failure:
> test_xss_using_nick_name(UsersControllerTest)
>
>
[/home/bnoll/tools/jruby-1.0/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/selector_assertions.rb:282:in
> `_wrap_assertion''
>
>
/home/bnoll/tools/jruby-1.0/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/selector_assertions.rb:282:in
> `assert_select''
>
>
/home/bnoll/projects/openlogic/olex-trunk/test/functional/users_controller_test.rb:30:in
> `test_xss_using_nick_name'']:
> Expected at least 1 elements, found 0.
> <false> is not true.
>
> 5 tests, 7 assertions, 1 failures, 0 errors
> rake aborted!
> Command failed with status (1): [/home/bnoll/tools/jruby-1.0/bin/jruby
> -Ili...]
>
> ############################
>
>
> I''m a newb to rails, so I''m hoping this will be obvious
to someone a
> bit more seasoned.
>
> TIA...
>
> Bryan
>
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---