Sha256: d1331f0a6da690dc617d10ecdfc2ae7555f3b45152a5ae3882dce9f8d753a912

Contents?: true

Size: 673 Bytes

Versions: 5

Compression:

Stored size: 673 Bytes

Contents

Capybara::SpecHelper.spec '#text' do
  it "should print the text of the page" do
    @session.visit('/with_simple_html')
    @session.text.should == 'Bar'
  end

  context "with css as default selector" do
    before { Capybara.default_selector = :css }
    it "should print the text of the page" do
      @session.visit('/with_simple_html')
      @session.text.should == 'Bar'
    end
    after { Capybara.default_selector = :xpath }
  end

  it "should strip whitespace" do
    @session.visit('/with_html')
    n = @session.find(:css, '#second')
    @session.find(:css, '#second').text.should =~ \
      /\ADuis aute .* text with whitespace .* est laborum\.\z/
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
capybara-2.0.3 lib/capybara/spec/session/text_spec.rb
capybara-2.0.2 lib/capybara/spec/session/text_spec.rb
capybara-2.0.1 lib/capybara/spec/session/text_spec.rb
capybara-2.0.0 lib/capybara/spec/session/text_spec.rb
capybara-2.0.0.beta4 lib/capybara/spec/session/text_spec.rb