From: Phlip <phlip2...@gmail.com>
Date: Sun, 05 Apr 2009 05:42:04 -0700
Local: Sun, Apr 5 2009 8:42 am
Subject: [ANN] assert{ 2.0 } 0.4.8 unit-tests Ajax using assert_rjs syntax + assert_xhtml
Railsters:
assert{ 2.0 } now contains "alpha" replacements for these assertions from the assert_rjs_ :alert, 'This is an alert' Notice these assertions are not yet drop-in compatible with assert_rjs classic - The improvement is they use racc and rkelly, which form a real JavaScript lexer. One common Ajax scenario revolves around sending Element.update() commands Everything inside the do...end blocks is assert_xhtml notation ( described here: def test_deleting_a_staff_sets_active_flag_to_false_instead_of_destroying_it assert_rjs_ :replace_html, :staff_list, /quentin/ do assert{ Staff.find_by_id(aaron.id).active? == false } The test shows :verbose! => true - use it to get a glimpse of your actual HTML The test also shows without!{} testing that aaron did indeed disappear from the Both :replace and :replace_html use this syntax. If anyone needs any other Get assert_rjs_ with: gem install racc rkelly nokogiri assert2 require 'assert2/rjs' (Note that assert2 contains more than one reusable module, so it does not -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||