mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
49cfacba1f
source returns the unmodified page source body returns the current dom html
26 lines
No EOL
718 B
Ruby
26 lines
No EOL
718 B
Ruby
module ClickSpec
|
|
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
|
|
end |