spec/element_spec.rb in opal-jquery-0.1.1 vs spec/element_spec.rb in opal-jquery-0.1.2

- old
+ new

@@ -182,5 +182,23 @@ foo.id.should == 'foo' foo.class_name.should == 'bar' end end end + +describe "Element#html" do + html <<-HTML + <div id="foo">bar</div> + HTML + + it "retrieves the inner html content for the element" do + expect(Element.id('foo').html).to include('bar') + end + + it "can be used to set inner html of element by passing string" do + foo = Element.id 'foo' + foo.html "different content" + + expect(foo.html).to_not include('bar') + expect(foo.html).to include('different content') + end +end