Sha256: 7a8f8a3a131ab2e86863e5f8001320b8de13d0cdfe5b834e668359a76278999f
Contents?: true
Size: 667 Bytes
Versions: 4
Compression:
Stored size: 667 Bytes
Contents
Capybara::SpecHelper.spec '#save_screenshot', requires: [:screenshot] do before do @session.visit '/foo' end it "generates sensible filename" do allow(@session.driver).to receive(:save_screenshot) @session.save_screenshot regexp = Regexp.new(File.expand_path('capybara-\d+\.png')) expect(@session.driver).to have_received(:save_screenshot).with(regexp, {}) end it "allows to specify another path" do allow(@session.driver).to receive(:save_screenshot) custom_path = 'screenshots/1.png' @session.save_screenshot(custom_path) expect(@session.driver).to have_received(:save_screenshot).with(custom_path, {}) end end
Version data entries
4 entries across 4 versions & 1 rubygems