Sha256: 989470074fd6524faae0ff06af95780c65f1d22b4f117ae6a4b4f2dee9474b67
Contents?: true
Size: 1.09 KB
Versions: 6
Compression:
Stored size: 1.09 KB
Contents
require "spec_helper" describe "Element height and width" do html <<-HTML <div id="dimensions" style='width: 100px; height: 200px'></div> HTML describe '#height' do it "should grab height of existing element" do elm = Element.id('dimensions') expect(elm.height).to eq(200) end it "should return nil if item does not exist" do elm = Element.find('#not-an-elm') expect(elm.height).to eq(nil) end end describe '#height=' do it "should allow us to set height" do elm = Element.id('dimensions') elm.height = 121 expect(elm.height).to eq(121) end end describe '#width' do it "should grab width of existing element" do elm = Element.id('dimensions') expect(elm.width).to eq(100) end it "should return nil if item does not exist" do elm = Element.find('#not-an-elm') expect(elm.width).to eq(nil) end end describe '#width=' do it "should allow us to set width" do elm = Element.id('dimensions') elm.width = 121 expect(elm.width).to eq(121) end end end
Version data entries
6 entries across 6 versions & 1 rubygems