spec/page-object/accessors_spec.rb in page-object-0.6.6 vs spec/page-object/accessors_spec.rb in page-object-0.6.7
- old
+ new
@@ -605,11 +605,14 @@
selenium_browser.should_receive(:find_elements).and_return([selected])
selenium_page_object.state.should == "OH"
end
it "should set the current item of a select list" do
+ option = double('option')
selenium_browser.should_receive(:find_element).and_return(selenium_browser)
- selenium_browser.should_receive(:send_keys).with("OH")
+ selenium_browser.should_receive(:find_elements).and_return([option])
+ option.should_receive(:text).and_return('OH')
+ option.should_receive(:click)
selenium_page_object.state = "OH"
end
it "should retrieve the select list element" do
selenium_browser.should_receive(:find_element).and_return(selenium_browser)