File: html_spec.rb

package info (click to toggle)
ruby-capybara 2.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 948 kB
  • ctags: 516
  • sloc: ruby: 7,998; makefile: 4
file content (38 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Capybara::SpecHelper.spec '#html' do
  it "should return the unmodified page body" do
    @session.visit('/')
    @session.html.should include('Hello world!')
  end

  it "should return the current state of the page", :requires => [:js] do
    @session.visit('/with_js')
    @session.html.should include('I changed it')
    @session.html.should_not include('This is text')
  end
end

Capybara::SpecHelper.spec '#source' do
  it "should return the unmodified page source" do
    @session.visit('/')
    @session.source.should include('Hello world!')
  end

  it "should return the current state of the page", :requires => [:js] do
    @session.visit('/with_js')
    @session.source.should include('I changed it')
    @session.source.should_not include('This is text')
  end
end

Capybara::SpecHelper.spec '#body' do
  it "should return the unmodified page source" do
    @session.visit('/')
    @session.body.should include('Hello world!')
  end

  it "should return the current state of the page", :requires => [:js] do
    @session.visit('/with_js')
    @session.body.should include('I changed it')
    @session.body.should_not include('This is text')
  end
end