Evgeny Bogdanov
2009-Jul-06 12:05 UTC
[rspec-users] [rspec][webrat] Bug? in have_tag for <a href="name">
Hello, I am writing a spec for the following html code: <a href="/home">Home</a> <a href="/logout">Logout</a> and I use webrat have_tag for specying it: response.body.should have_tag(''a'', :href => "/home", :content => "Home") response.body.should have_tag(''a'', :href => "/logout", :content => "Logout") If I put :href to be "/home2" or :content to be "Home1" the spec still passes, though it shouldn''t as I understand. Does somebody know what I am doing wrong? Thank you in advance, Evgeny
David Chelimsky
2009-Jul-06 12:27 UTC
[rspec-users] [rspec][webrat] Bug? in have_tag for <a href="name">
On Mon, Jul 6, 2009 at 7:05 AM, Evgeny Bogdanov<evgeny.bogdanov at gmail.com> wrote:> Hello, > > I am writing a spec for the following html code: > <a href="/home">Home</a> > <a href="/logout">Logout</a> > > and I use webrat have_tag for specying it: > response.body.should have_tag(''a'', :href => "/home", :content => > "Home") > response.body.should have_tag(''a'', :href => "/logout", :content => > "Logout") > > If I put :href to be "/home2" or :content to be "Home1" the spec still > passes, > though it shouldn''t as I understand. > > Does somebody know what I am doing wrong?Try have_selector instead. I think that have_tag doesn''t pay attention to the hash args (:href => etc).> Thank you in advance, > Evgeny > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >