[rspec-users] Writing specs for scriptaculous helper

Leslie Freeman leslief at sunquake.net
Sat Sep 8 19:17:45 EDT 2007

I'm trying to get full specing of my views, which involve calling  
some Scriptaculous helpers in the views themselves. For instance, I  
have a div containing a bunch of thumbnails which I'm going to make  
sortable with sortable_element. I'm trying to figure out a good way  
to write a spec for this type of call. so far the closest I have  
gotten is to write something like

response.should have_text Regexp.new('Sortable.create\ 

Which works, but seems a bit ugly (and could possibly break if  
Scriptaculous changed. It just seems a little too "hard coded". Is  
there a better way?


More information about the rspec-users mailing list