spec/page_spec.rb in bret-watircraft-0.4.5 vs spec/page_spec.rb in bret-watircraft-0.5.0
- old
+ new
@@ -339,9 +339,32 @@
it "should not raise an exception if a field isn't found" do
uses_table_page
@table_page.results.row(:missing => 'nada').should be_nil
end
+
+ it "should be able to be listed from the page" do
+ uses_table_page
+ @table_page.tables.should == ['results']
+ end
+
+ it "should list its fields" do
+ uses_table_page
+ @table_page.results.fields.should == %w(name phone missing)
+ end
+
+ it "should list its elements" do
+ @page_class.class_eval do
+ element(:results_table) do FakeTable.new []
+ end
+ table(:results) do
+ field(:name){row.element(:letter)}
+ element(:phone){row.element(:number)}
+ end
+ end
+ @table_page = @page_class.new
+ @table_page.results.elements.should == %w(name_field phone)
+ end
end
end