Skip to content

Commit

Permalink
Add test for click_on
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed May 13, 2019
1 parent 185bfcd commit d65b8a8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/capybara/spec/session/click_on_spec.rb
@@ -0,0 +1,15 @@
# frozen_string_literal: true

Capybara::SpecHelper.spec '#click_on' do
it 'should default to being an alias for #click_link_or_button' do
@session.visit('/form')
@session.click_on('awe123')
expect(extract_results(@session)['first_name']).to eq('John')
end

it 'should allow specifying a selector type' do
@session.visit('/form')
cbox = @session.click_on(:checkbox, 'form_terms_of_use')
expect(cbox).to be_checked
end
end

0 comments on commit d65b8a8

Please sign in to comment.