spec/table_headers_spec.rb in celerity-0.0.3 vs spec/table_headers_spec.rb in celerity-0.0.4
- old
+ new
@@ -1,32 +1,33 @@
require File.dirname(__FILE__) + '/spec_helper.rb'
-describe TableHeaders do
+describe "TableHeaders" do
before :all do
- @browser = IE.new
- add_spec_checker(@browser)
+ @browser = Browser.new
end
before :each do
- @browser = IE.new
+ @browser = Browser.new
@browser.goto(TEST_HOST + "/tables.html")
end
describe "#length" do
it "should return the correct number of table theads (page context)" do
@browser.theads.length.should == 1
end
+
it "should return the correct number of table theads (table context)" do
@browser.table(:index, 1).theads.length.should == 1
end
end
describe "#[]" do
it "should return the row at the given index (page context)" do
@browser.theads[1].id.should == "tax_headers"
end
+
it "should return the row at the given index (table context)" do
@browser.table(:index, 1).theads[1].id.should == "tax_headers"
end
end
@@ -34,10 +35,11 @@
it "should iterate through table theads correctly (page context)" do
@browser.theads.each_with_index do |thead, index|
thead.name.should == @browser.thead(:index, index+1).name
thead.id.should == @browser.thead(:index, index+1).id
end
- end
+ end
+
it "should iterate through table theads correctly (table context)" do
table = @browser.table(:index, 1)
table.theads.each_with_index do |thead, index|
thead.name.should == table.thead(:index, index+1).name
thead.id.should == table.thead(:index, index+1).id