I just started the book and was having the same problem. In particular the line
assert_match /Prawn/, page.body
in test/integration/navigation_test.rb was giving the following error
output error : invalid character value
When I change from page.body to page.source all is well.
I haven’t figured out what is going on here, but it looks like maybe a non-printable character in the pdf is causing problems? Perhaps my charset is incorrect?
Will take a closer look tomorrow …
(Update)
Looks like this error message is coming from libxml2.
The call out comes from the native_write_to() call in nokogiri-1.5.0/ext/nokogiri/xml_node.c which then uses xml2 services.
I didn’t have time to track it further, but it looks like pdf text is getting parsed as xml and the xml is reporting one of the characters as invalid.
I tried rolling back to rails version 3.0.3 and got the same result, so it is likely in some other gem.
(Update 2)
Got “assert_match /Prawn/, page.body” to work when I added the following to my Gemfile
gem “capybara”, “0.4.0”
gem “prawn”, “0.8.4”