spec/page-object/elements/button_spec.rb in page-object-0.5.4 vs spec/page-object/elements/button_spec.rb in page-object-0.5.5
- old
+ new
@@ -21,9 +21,25 @@
end
describe "interface" do
let(:button_element) { double('button_element') }
+ it "should register with type :submit" do
+ ::PageObject::Elements.element_class_for(:input, :submit).should == ::PageObject::Elements::Button
+ end
+
+ it "should register with type :image" do
+ ::PageObject::Elements.element_class_for(:input, :image).should == ::PageObject::Elements::Button
+ end
+
+ it "should register with type :button" do
+ ::PageObject::Elements.element_class_for(:input, :button).should == ::PageObject::Elements::Button
+ end
+
+ it "should retisger with type :reset" do
+ ::PageObject::Elements.element_class_for(:input, :reset).should == ::PageObject::Elements::Button
+ end
+
context "for selenium" do
it "should return error when asked for its' text" do
button = PageObject::Elements::Button.new(button_element, :platform => :selenium_webdriver)
lambda { button.text }.should raise_error
end