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/screenshot.rb
sanemat 304a38f7b0 Add magic comment for Ruby2.0.0
Ruby2.0.0 default encoding is UTF-8 instead of US_ASCII
2012-12-16 01:57:03 +09:00

14 lines
361 B
Ruby

#coding: US-ASCII
Capybara::SpecHelper.spec "#save_screenshot" do
let(:image_path) { File.join(Dir.tmpdir, 'capybara-screenshot.png') }
before do
@session.visit '/'
@session.save_screenshot image_path
end
it "should generate PNG file", :requires => [:screenshot] do
magic = File.read(image_path, 4)
magic.should eq "\x89PNG"
end
end