spec/support/shared/element/capabilities/with_node.rb in arachni-1.0.5 vs spec/support/shared/element/capabilities/with_node.rb in arachni-1.0.6

- old
+ new

@@ -12,9 +12,34 @@ it "includes 'html'" do data['html'].should == html end end + describe '#html=' do + context 'when given' do + context String do + let(:string) { 'stuff' } + + it 'recodes it' do + expect(string).to receive(:recode) + with_node.html = string + end + + it 'sets the #html' do + with_node.html = string + with_node.html.should == string + end + end + + context 'nil' do + it 'sets the #html' do + with_node.html = nil + with_node.html.should be_nil + end + end + end + end + describe '#node' do it 'returns the set node' do node = with_node.node node.is_a?( Nokogiri::XML::Element ).should be_true node.to_s.should == Nokogiri::HTML.fragment( html ).to_s