it 'should use Ajax to replace person 45' do
xhr :get, :replace_person, :id => 45
@response.body.should send_js_to(:replace_html, 'person_45') do
strong 'person_45'
end
end
Once again, the do-end block calls Nokogiri::HTML::Builder to build a
sample of
HTML. The assertion then matches this to the HTML delivered in the
payload of
the JS Element.update() call.
The committee is unaware of any other RJS solution for RSpec…
Is there any plan to allow for negative assertions (e.g., should_not
be_html_with)? I use this in a custom matcher, and can’t think of a way
to
support negative assertions unless be_html_with does.
I’m of course going by the output of negative_failure_message saying not
to
use it that way.
Is there any plan to allow for negative assertions (e.g., should_not
be_html_with)? I use this in a custom matcher, and can’t think of a way to
support negative assertions unless be_html_with does.
I can’t think of a reason not to use .should be_html_with{ without!{
…} }
And it seems that .should_not be_html_with() would, in theory, pass if a
page
weren’t HTML…