1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/lib/capybara/spec/session/html_spec.rb

41 lines
1.2 KiB
Ruby
Raw Normal View History

2016-03-07 19:52:19 -05:00
# frozen_string_literal: true
2018-02-28 19:11:41 -05:00
Capybara::SpecHelper.spec '#html' do
it "should return the unmodified page body" do
@session.visit('/')
expect(@session.html).to include('Hello world!')
end
2016-10-04 14:10:29 -04:00
it "should return the current state of the page", requires: [:js] do
@session.visit('/with_js')
expect(@session.html).to include('I changed it')
expect(@session.html).not_to include('This is text')
end
end
Capybara::SpecHelper.spec '#source' do
it "should return the unmodified page source" do
@session.visit('/')
expect(@session.source).to include('Hello world!')
end
2016-10-04 14:10:29 -04:00
it "should return the current state of the page", requires: [:js] do
@session.visit('/with_js')
expect(@session.source).to include('I changed it')
expect(@session.source).not_to include('This is text')
end
end
Capybara::SpecHelper.spec '#body' do
it "should return the unmodified page source" do
@session.visit('/')
expect(@session.body).to include('Hello world!')
end
2016-10-04 14:10:29 -04:00
it "should return the current state of the page", requires: [:js] do
@session.visit('/with_js')
expect(@session.body).to include('I changed it')
expect(@session.body).not_to include('This is text')
end
end