Skip to content

Commit

Permalink
getting ready for rspec 3
Browse files Browse the repository at this point in the history
  • Loading branch information
cheezy committed Mar 2, 2014
1 parent 05ff5a6 commit b9bd99c
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spec/page-object/elements/select_list_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
sel_list.should_receive(:find_elements).and_return(opts) sel_list.should_receive(:find_elements).and_return(opts)
opts[0].should_receive(:selected?).twice.and_return(true) opts[0].should_receive(:selected?).twice.and_return(true)
opts[0].should_receive(:text).and_return('blah') opts[0].should_receive(:text).and_return('blah')
selenium_sel_list.selected?('blah').should be_true selenium_sel_list.selected?('blah').should be true
end end


it "should be able to clear selected options" do it "should be able to clear selected options" do
Expand Down
2 changes: 1 addition & 1 deletion spec/page-object/elements/selenium_element_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@


it "should know how to retrieve the value of an attribute" do it "should know how to retrieve the value of an attribute" do
@selenium_driver.should_receive(:attribute).and_return(true) @selenium_driver.should_receive(:attribute).and_return(true)
@selenium_element.attribute('readonly').should be_true @selenium_element.attribute('readonly').should be true
end end


it "should be clickable" do it "should be clickable" do
Expand Down
2 changes: 1 addition & 1 deletion spec/page-object/elements/table_cell_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
it "should always be enabled" do it "should always be enabled" do
table_cell_element = double('table_cell_element') table_cell_element = double('table_cell_element')
table_cell = PageObject::Elements::TableCell.new(table_cell_element, :platform => :selenium_webdriver) table_cell = PageObject::Elements::TableCell.new(table_cell_element, :platform => :selenium_webdriver)
table_cell.enabled?.should be_true table_cell.enabled?.should be true
end end
end end
end end
2 changes: 1 addition & 1 deletion spec/page-object/elements/watir_element_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
it "should know how to retrieve the value of an attribute" do it "should know how to retrieve the value of an attribute" do
watir_driver.stub(:attribute_value).and_return(true) watir_driver.stub(:attribute_value).and_return(true)
watir_driver.stub(:attribute).and_return(true) watir_driver.stub(:attribute).and_return(true)
watir_element.attribute("readonly").should be_true watir_element.attribute("readonly").should be true
end end


it "should be clickable" do it "should be clickable" do
Expand Down
4 changes: 2 additions & 2 deletions spec/page-object/page-object_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def initialize_page
end end


@page = CallbackPage.new(watir_browser) @page = CallbackPage.new(watir_browser)
@page.initialize_page_called.should be_true @page.initialize_page_called.should be true
end end


it "should call initialize_accessors if it exists" do it "should call initialize_accessors if it exists" do
Expand All @@ -137,7 +137,7 @@ def initialize_accessors
end end


@page = CallbackPage.new(watir_browser) @page = CallbackPage.new(watir_browser)
@page.initialize_accessors_called.should be_true @page.initialize_accessors_called.should be true
end end


it "should call initialize_accessors before initialize_page if both exist" do it "should call initialize_accessors before initialize_page if both exist" do
Expand Down
2 changes: 1 addition & 1 deletion spec/page-object/page_factory_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TestWorld < WorldSuper
class NoPO class NoPO
end end
@world.on(NoPO) @world.on(NoPO)
@world.super_called.should be_true @world.super_called.should be true
end end


it "should create a new page object and execute a block" do it "should create a new page object and execute a block" do
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SeleniumTestPageObject
it "should know it is not exist" do it "should know it is not exist" do
selenium_browser.should_receive(:find_element).twice.and_raise(Selenium::WebDriver::Error::NoSuchElementError) selenium_browser.should_receive(:find_element).twice.and_raise(Selenium::WebDriver::Error::NoSuchElementError)
page = SeleniumTestPageObject.new(selenium_browser) page = SeleniumTestPageObject.new(selenium_browser)
page.link_element(:text => 'blah').element.exists?.should be_false page.link_element(:text => 'blah').element.exists?.should be false
end end


it "should know it is not visible" do it "should know it is not visible" do
Expand Down
2 changes: 1 addition & 1 deletion spec/page-object/selenium_accessors_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class SeleniumBlockPageObject
it "should know if a check box element is selected" do it "should know if a check box element is selected" do
selenium_browser.should_receive(:find_element).and_return(selenium_browser) selenium_browser.should_receive(:find_element).and_return(selenium_browser)
selenium_browser.should_receive(:selected?).and_return(true) selenium_browser.should_receive(:selected?).and_return(true)
selenium_page_object.active_checked?.should be_true selenium_page_object.active_checked?.should be true
end end


it "should retrieve a checkbox element" do it "should retrieve a checkbox element" do
Expand Down
2 changes: 1 addition & 1 deletion spec/page-object/watir_accessors_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def mock_driver_for(tag)
it "should know if a check box element is selected" do it "should know if a check box element is selected" do
watir_browser.should_receive(:checkbox).and_return(watir_browser) watir_browser.should_receive(:checkbox).and_return(watir_browser)
watir_browser.should_receive(:set?).and_return(true) watir_browser.should_receive(:set?).and_return(true)
watir_page_object.active_checked?.should be_true watir_page_object.active_checked?.should be true
end end


it "should retrieve a checkbox element" do it "should retrieve a checkbox element" do
Expand Down

0 comments on commit b9bd99c

Please sign in to comment.