Sha256: 93ed0d2c0aadd6523051bcb8d5d9dbb018ebaa87e904eb691eb5b235ed0e7ba8

Contents?: true

Size: 648 Bytes

Versions: 12

Compression:

Stored size: 648 Bytes

Contents

shared_examples_for "click" do
  describe '#click' do
    it "should click on a link" do
      @session.visit('/with_html')
      @session.click('labore')
      @session.body.should include('Bar')
    end

    it "should click on a button" do
      @session.visit('/form')
      @session.click('awe123')
      extract_results(@session)['first_name'].should == 'John'
    end

    context "with a locator that doesn't exist" do
      it "should raise an error" do
        @session.visit('/with_html')
        running do
          @session.click('does not exist')
        end.should raise_error(Capybara::ElementNotFound)
      end
    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/click_spec.rb
capybara-0.3.9 lib/capybara/spec/session/click_spec.rb
david-capybara-0.3.8 lib/capybara/spec/session/click_spec.rb
katzil-capybara-0.3.8 lib/capybara/spec/session/click_spec.rb
capybara-0.3.8 lib/capybara/spec/session/click_spec.rb
pr0d1r2-capybara-0.3.7 lib/capybara/spec/session/click_spec.rb
capybara-0.3.7 lib/capybara/spec/session/click_spec.rb
capybara-0.3.6 spec/dsl/click_spec.rb
h13ronim-capybara-0.3.0.1 spec/dsl/click_spec.rb
capybara-0.3.5 spec/dsl/click_spec.rb
bjeanes-capybara-0.3.2 spec/dsl/click_spec.rb
bjeanes-capybara-0.3.1 spec/dsl/click_spec.rb