I'm writing specs for an XHR, and am having troubles getting my specs to see that a <div> is being hidden.

=== map_filter.rjs
 19 else
 20 puts "map_filter.rjs> else!"
 21   # Display the filter errors.
 22   page['map-filter-errors'].hide
 23   page['map-filter-errors'].replace_html @map_filter_errors.join
 24   page['map-filter-errors'].visual_effect :blind_down
 25 end

When the spec runs, line 20 above spits out "...else!" on the CLI, so I know that the RJS file is being processed.

=== neighbourhoods_controller_spec.rb
428       describe 'with views integrated' do
429         integrate_views
430
431         it 'should hide the map filter errors <div>' do
432           do_xhr @xhr_params
433           response.should have_rjs
434 #          response.should have_rjs(:hide, 'map-filter-errors')
435         end
436       end

Why might line 433 above fail?:

===
$ script/spec -e 'should hide the map filter errors <div>' spec/ controllers/neighbourhoods_controller_spec.rb
map_filter.rjs> else!
F

1)
'NeighbourhoodsController handling POST /neighbourhoods/map_filter if a filter error occured with views integrated should hide the map filter errors <div>' FAILED
No RJS statement that replaces or inserts HTML content.
./spec/controllers/neighbourhoods_controller_spec.rb:433:
script/spec:4:

Finished in 0.489336 seconds

1 example, 1 failure
===

Any hints?
-Nick
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to