Sha256: c2ccc041bd6bd02b150dff1612c07130c3f779f07968ebd73ec053eef460cce0

Contents?: true

Size: 1.75 KB

Versions: 9

Compression:

Stored size: 1.75 KB

Contents

require 'spec_helper'

describe Symbiont::Generators do
  let(:watir_browser) { mock_browser_for_watir }
  let(:watir_definition) { DefinitionTest.new(watir_browser) }
  
  describe "table web objects" do
    context "when declared in a definition" do
      it "should generate methods for referencing the table" do
        watir_definition.should respond_to(:accounts_table)
        watir_definition.should respond_to(:accounts_object)
      end
      
      it "should generate methods for interacting with the table" do
        watir_definition.should respond_to(:accounts_exists?)
        watir_definition.should respond_to(:accounts?)
        watir_definition.should respond_to(:accounts_visible?)
        watir_definition.should respond_to(:accounts_?)
      end
    end
    
    context "when used by the watir platform" do
      it "should locate the table" do
        watir_browser.should_receive(:table).and_return(watir_browser)
        web_object = watir_definition.accounts_table
        web_object.should_not be_nil
        web_object.should be_instance_of Symbiont::WebObjects::Table
      end
      
      it "should determine if a table exists" do
        watir_browser.should_receive(:table).twice.and_return(watir_browser)
        watir_browser.should_receive(:exists?).twice.and_return(watir_browser)
        watir_definition.accounts_exists?.should be_true
        watir_definition.accounts?.should be_true
      end
      
      it "should determine if a table is visible" do
        watir_browser.should_receive(:table).twice.and_return(watir_browser)
        watir_browser.should_receive(:visible?).twice.and_return(watir_browser)
        watir_definition.accounts_visible?.should be_true
        watir_definition.accounts_?.should be_true
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
symbiont-0.1.8 spec/symbiont/generators/table_generators_spec.rb
symbiont-0.1.7 spec/symbiont/generators/table_generators_spec.rb
symbiont-0.1.6 spec/symbiont/generators/table_generators_spec.rb
symbiont-0.1.5 spec/symbiont/generators/table_generators_spec.rb
symbiont-0.1.4 spec/symbiont/generators/table_generators_spec.rb
symbiont-0.1.3 spec/symbiont/generators/table_generators_spec.rb
symbiont-0.1.2 spec/symbiont/generators/table_generators_spec.rb
symbiont-0.1.1 spec/symbiont/generators/table_generators_spec.rb
symbiont-0.1.0 spec/symbiont/generators/table_generators_spec.rb