Skip to content

Instantly share code, notes, and snippets.

@LBRapid
Created May 3, 2016 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LBRapid/08e5453e1644608369e3a631b0b7a766 to your computer and use it in GitHub Desktop.
Save LBRapid/08e5453e1644608369e3a631b0b7a766 to your computer and use it in GitHub Desktop.
require 'capybara_helper'
class LabPrintSaveTest < ActionDispatch::IntegrationTest
it 'save a design through print' do
stub_rack_proxy
insert_cassette 'capybara_lab_print_save'
visit_empty_lab
click_link 'add text'
fill_in 'addText_newText_textEntry', with: "test text"
click_button 'Next'
click_link 'Print This'
begin
switch_to_new_pop_up
has_text? "Save Your Design"
fill_in 'Name Your Design:', with: "123"
fill_in 'Your Email Address:', with: "test@customink.com"
click_button 'Save and Print'
has_text? "PRINTED PROOF"
close_active_window
has_no_text? 'PRINTED PROOF'
has_text? 'Save Completed'
rescue Capybara::Poltergeist::JavascriptError
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment