Quantcast
Channel: Pragmatic Forums | Posts in topic 'page.source instead of page.body?'
Viewing all articles
Browse latest Browse all 42

page.source instead of page.body? posted by Fred Boldireff @ Sat, 05 Nov 2011 14:02:10 +0000

$
0
0

Having a glance at how prawn is tested, I managed to make this initial test pass using latests versions of capybara (1.1.1) and prawn (0.12.0) by replacing

assert_match /Prawn/, page.body

with
src_txt = PDF::Inspector::Text.analyze(page.source)
assert_match  /Prawn/, src_txt.strings.first

I had to install the ‘pdf-inspector’ gem, and require ‘pdf/inspector’ in test_helper.rb

It seems that due to page.body containing PDF raw data which makes Capybara::Session trip when you try to evaluate it.


Viewing all articles
Browse latest Browse all 42

Latest Images

Trending Articles



Latest Images