Sha256: 8310263129e3001f71d3706cb8975624bb505cb880a8376ae7e117d3562ddda5
Contents?: true
Size: 1.24 KB
Versions: 6
Compression:
Stored size: 1.24 KB
Contents
require 'spec_helper' require 'druid/elements' describe Druid::Elements::TableRow do describe "when mapping how to find an element" do it "should map watir types to same" do [:class, :id, :name, :xpath, :index].each do |t| identifier = Druid::Elements::TableRow.identifier_for t => 'value' expect(identifier.keys.first).to eql t end end end describe "interface" do let(:element) { double 'element' } let(:table_row) { Druid::Elements::TableRow.new(element) } it "should return a table cell when indexed" do expect(element).to receive(:[]).with(1) expect(table_row[1]).to be_instance_of Druid::Elements::TableCell end it "should return the number of columns" do expect(element).to receive_message_chain(:cells, :size).and_return(3) expect(table_row.columns).to eql 3 end it "should iterate over the table columns" do expect(table_row).to receive(:columns).and_return(3) allow(table_row).to receive(:[]) count = 0 table_row.each do count += 1 end expect(count).to eql 3 end it "should register with tag_name :tr" do expect(Druid::Elements.element_class_for(:tr)).to be Druid::Elements::TableRow end end end
Version data entries
6 entries across 6 versions & 1 rubygems