Guest User

Untitled

a guest
Jul 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. require 'rails_helper'
  2.  
  3. RSpec.feature 'Dashboard', type: :feature, js: true do
  4. let!(:robot1) { FactoryBot.create(:robot, :qa_passed) }
  5. let!(:robot2) { FactoryBot.create(:robot, :factory_second) }
  6. let!(:robot3) { FactoryBot.create(:robot) }
  7. let!(:robot4) { FactoryBot.create(:robot, :with_shipment) }
  8. background { visit root_path }
  9.  
  10. scenario 'send shipment' do
  11. expect(page).to have_content('Ready to ship')
  12.  
  13. within '.qa-passed' do
  14. click_button 'Add to shipment'
  15. end
  16.  
  17. within '.factory-second' do
  18. click_button 'Add to shipment'
  19. end
  20.  
  21. within '.shipping-list' do
  22. click_button 'Send shipment'
  23. end
  24.  
  25. expect(page).to have_content("Robots #{robot1.id}, #{robot2.id} is shipped successfully.")
  26. end
  27. end
Add Comment
Please, Sign In to add comment