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
2012-07-21 16:46:56 -04:00

13 lines
343 B
Ruby

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