diff options
author | tony <tony> | 2009-03-09 10:09:05 +0000 |
---|---|---|
committer | tony <tony> | 2009-03-09 10:09:05 +0000 |
commit | 534735b27dbadd34c00fead2f56de592686582f7 (patch) | |
tree | 6354af8bc28119e9f1fa9be5ba6cd4e405906ed7 /spec/controllers/request_controller_spec.rb | |
parent | bff6d94c4246f6cd6ab15f486b388522de08435c (diff) |
use have_tag() to narrow the test to the correct scope
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 64552f18b..72829b26f 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -483,14 +483,15 @@ describe RequestController, "when viewing comments" do it "should link to the user who submitted it" do session[:user_id] = users(:bob_smith_user).id get :show, :url_title => 'why_do_you_have_such_a_fancy_dog' - response.should have_text(/silly_emnameem.*?>\s+left an annotation/) - response.should_not have_text(/You\s+left an annotation/) + response.body.should have_tag("div#comment-1 h2", /Silly.*left an annotation/m) + response.body.should_not have_tag("div#comment-1 h2", /You.*left an annotation/m) end it "should say if you were the user who submitted it" do session[:user_id] = users(:silly_name_user).id get :show, :url_title => 'why_do_you_have_such_a_fancy_dog' - response.should have_text(/You\s+left an annotation/) + response.body.should_not have_tag("div#comment-1 h2", /Silly.*left an annotation/m) + response.body.should have_tag("div#comment-1 h2", /You.*left an annotation/m) end end |