[rspec-devel] [ rspec-Bugs-8392 ] should_have_tag :content => true fails to match correctly

noreply at rubyforge.org noreply at rubyforge.org
Fri Feb 2 11:10:37 EST 2007


Bugs item #8392, was opened at 2007-02-02 16:10
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8392&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Jerry West (jjw)
Assigned to: Nobody (None)
Summary: should_have_tag :content => true fails to match correctly

Initial Comment:
The docs for assert_tag suggest that :content => true should match non-empty tags.  Rspec.should_have_tag does not seem to honour this.

In order: the failing spec; the rhtml file itself, and the spec run output 

------
require File.dirname(__FILE__) + '/../../spec_helper'

context 'a view spec' do
  specify 'should set a title' do
    render '/sessions/test.rhtml'
    response.should_have_tag 'title',
      :content => true
 end
end
------
<title>Hello</title>
------
'a view spec should set a title' FAILED
<title>Hello</title>
 should include ["[\title\, {:content=>true}]"]
.../vendor/plugins/rspec_on_rails/lib/spec/rails/tag_expectations.rb:15:in `raise_rspec_error'
.../vendor/plugins/rspec_on_rails/lib/spec/rails/tag_expectations.rb:5:in `should_have_tag'
.../vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/test_response.rb:30:in `should_have_tag'
./spec/views/sessions/test_rhtml_spec.rb:6:
-------

I think I saw something about Rspec moving to assert_select, so feel free to close this if it's not worth fixing because of that.


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8392&group_id=797


More information about the rspec-devel mailing list