[rspec-users] specs for RJS

Ben Tucker ben at greenriver.org
Thu Oct 25 02:11:22 EDT 2007

What's the current best practice for spec'ing (and stubbing) RJS?
response.should have_rjs(*args, &block) from rspec_on_rails works well
for things that
assert_select_rjs supports.  But for other things, like say
page[:elm].add_class_name :class_name, it's not clear to me the best
way to test for this.

I'd love to be able to do something like
page[:elm].should_receive(:add_class_name).with(:class_name).  Is this
possible to do?

Thanks!  Rspec rocks!


More information about the rspec-users mailing list