Sha256: 833c303ba2af394f664dd9f5825f2159f97f8db10ba155e76580950ad0cc2436

Contents?: true

Size: 448 Bytes

Versions: 12

Compression:

Stored size: 448 Bytes

Contents

shared_examples_for "find_by_id" do  
  describe '#find_by_id' do
    before do
      @session.visit('/with_html')
    end

    it "should find any element by id" do
      @session.find_by_id('red').tag_name.should == 'a'
      @session.find_by_id('hidden_via_ancestor').tag_name.should == 'div'
    end

    it "should return nil if no element with id is found" do
      @session.find_by_id('nothing_with_this_id').should be_nil
    end
  end
end

Version data entries

12 entries across 12 versions & 6 rubygems

Version Path
david-capybara-0.3.9.1 lib/capybara/spec/session/find_by_id_spec.rb
capybara-0.3.9 lib/capybara/spec/session/find_by_id_spec.rb
david-capybara-0.3.8 lib/capybara/spec/session/find_by_id_spec.rb
katzil-capybara-0.3.8 lib/capybara/spec/session/find_by_id_spec.rb
capybara-0.3.8 lib/capybara/spec/session/find_by_id_spec.rb
pr0d1r2-capybara-0.3.7 lib/capybara/spec/session/find_by_id_spec.rb
capybara-0.3.7 lib/capybara/spec/session/find_by_id_spec.rb
capybara-0.3.6 spec/dsl/find_by_id_spec.rb
h13ronim-capybara-0.3.0.1 spec/dsl/find_by_id_spec.rb
capybara-0.3.5 spec/dsl/find_by_id_spec.rb
bjeanes-capybara-0.3.2 spec/dsl/find_by_id_spec.rb
bjeanes-capybara-0.3.1 spec/dsl/find_by_id_spec.rb