Sha256: b4fb0e311e760d82713f4f11b7c659c4013925b8827b671d891c562e76f3cc12

Contents?: true

Size: 703 Bytes

Versions: 52

Compression:

Stored size: 703 Bytes

Contents

shared_examples_for "choose" do

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

    it "should choose a radio button by id" do
      @session.choose("gender_male")
      @session.click_button('awesome')
      extract_results(@session)['gender'].should == 'male'
    end

    it "should choose a radio button by label" do
      @session.choose("Both")
      @session.click_button('awesome')
      extract_results(@session)['gender'].should == 'both'
    end

    context "with a locator that doesn't exist" do
      it "should raise an error" do
        running { @session.choose('does not exist') }.should raise_error(Capybara::ElementNotFound)
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 13 rubygems

Version Path
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.4/lib/capybara/spec/session/choose_spec.rb
capybara-1.1.4 lib/capybara/spec/session/choose_spec.rb
capybara-1.1.3 lib/capybara/spec/session/choose_spec.rb
nimboids-capybara-1.1.2 lib/capybara/spec/session/choose_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/lib/capybara/spec/session/choose_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/lib/capybara/spec/session/choose_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/lib/capybara/spec/session/choose_spec.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/lib/capybara/spec/session/choose_spec.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/lib/capybara/spec/session/choose_spec.rb
capybara_minitest_spec-0.2.2 test_app/session/choose_spec.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/lib/capybara/spec/session/choose_spec.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/lib/capybara/spec/session/choose_spec.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/lib/capybara/spec/session/choose_spec.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/lib/capybara/spec/session/choose_spec.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/lib/capybara/spec/session/choose_spec.rb
capybara_minitest_spec-0.2.1.1 test_app/session/choose_spec.rb
capybara-1.1.2 lib/capybara/spec/session/choose_spec.rb
capybara_minitest_spec-0.2.1 test_app/session/choose_spec.rb
capybara_minitest_spec-0.2.0 test_app/session/choose_spec.rb
capybara_minitest_spec-0.1.3 test_app/session/choose_spec.rb