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 6, 2019
1 parent 671e0c6 commit dc7b23f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/capybara/spec/session/click_on_spec.rb
Original file line number Diff line number Diff line change
@@ -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 dc7b23f

Please sign in to comment.