Sha256: d992a55278510c76e351b0e0be138ee2fe8e15d3e9d98149a639c5b555e90fc4

Contents?: true

Size: 833 Bytes

Versions: 42

Compression:

Stored size: 833 Bytes

Contents

shared_examples_for "find_field" do  
  describe '#find_field' do
    before do
      @session.visit('/form')
    end

    it "should find any field" do
      @session.find_field('Dog').value.should == 'dog'
      @session.find_field('form_description').text.should == 'Descriptive text goes here'
      @session.find_field('Region')[:name].should == 'form[region]'
    end

    it "should raise error if the field doesn't exist" do
      running do
        @session.find_field('Does not exist')
      end.should raise_error(Capybara::ElementNotFound)
    end

    it "should be aliased as 'field_labeled' for webrat compatibility" do
      @session.field_labeled('Dog').value.should == 'dog'
      running do
        @session.field_labeled('Does not exist')
      end.should raise_error(Capybara::ElementNotFound)
    end
  end
end

Version data entries

42 entries across 42 versions & 9 rubygems

Version Path
capybara_minitest_spec-0.2.0 test_app/session/find_field_spec.rb
capybara_minitest_spec-0.1.3 test_app/session/find_field_spec.rb
capybara_minitest_spec-0.1.2 test_app/session/find_field_spec.rb
capybara_minitest_spec-0.1.1 test_app/session/find_field_spec.rb
capybara_minitest_spec-0.1.0 test_app/session/find_field_spec.rb
capybara-1.1.1 lib/capybara/spec/session/find_field_spec.rb
capybara-1.1.0 lib/capybara/spec/session/find_field_spec.rb
capybara-1.1.0.rc1 lib/capybara/spec/session/find_field_spec.rb
capybara-1.0.1 lib/capybara/spec/session/find_field_spec.rb
capybara-1.0.0 lib/capybara/spec/session/find_field_spec.rb
capybara-1.0.0.rc1 lib/capybara/spec/session/find_field_spec.rb
capybara-1.0.0.beta1 lib/capybara/spec/session/find_field_spec.rb
capybara-0.4.1.2 lib/capybara/spec/session/find_field_spec.rb
capybara-rails-2-2-0.4.1.1 lib/capybara/spec/session/find_field_spec.rb
rcarvalho-capybara-0.4.1.2 lib/capybara/spec/session/find_field_spec.rb
rcarvalho-capybara-0.4.1.1 lib/capybara/spec/session/find_field_spec.rb
capybara-0.4.1.1 lib/capybara/spec/session/find_field_spec.rb
capybara-0.4.1.rc lib/capybara/spec/session/find_field_spec.rb
yannp-capybara-0.4.0 lib/capybara/spec/session/find_field_spec.rb
capybara-0.4.0 lib/capybara/spec/session/find_field_spec.rb