Sha256: 10ae59de39e8d4151b147d9213168dc53cc7224008ebf6e1adbb51e5ca0d6617

Contents?: true

Size: 518 Bytes

Versions: 5

Compression:

Stored size: 518 Bytes

Contents

Capybara::SpecHelper.spec '#find_button' do
  before do
    @session.visit('/form')
  end

  it "should find any button" do
    @session.find_button('med')[:id].should == "mediocre"
    @session.find_button('crap321').value.should == "crappy"
  end

  it "casts to string" do
    @session.find_button(:'med')[:id].should == "mediocre"
  end

  it "should raise error if the button doesn't exist" do
    expect do
      @session.find_button('Does not exist')
    end.to raise_error(Capybara::ElementNotFound)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
capybara-2.0.3 lib/capybara/spec/session/find_button_spec.rb
capybara-2.0.2 lib/capybara/spec/session/find_button_spec.rb
capybara-2.0.1 lib/capybara/spec/session/find_button_spec.rb
capybara-2.0.0 lib/capybara/spec/session/find_button_spec.rb
capybara-2.0.0.beta4 lib/capybara/spec/session/find_button_spec.rb