Skip to content

Instantly share code, notes, and snippets.

@somethvictory
Created July 19, 2018 09:02
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 somethvictory/1dfcc8c58ef536fa88fc78197952a415 to your computer and use it in GitHub Desktop.
Save somethvictory/1dfcc8c58ef536fa88fc78197952a415 to your computer and use it in GitHub Desktop.
require 'rails_helper'
RSpec.feature 'Dashboard', type: :feature, js: true do
let!(:robot1) { FactoryBot.create(:robot, :qa_passed) }
let!(:robot2) { FactoryBot.create(:robot, :factory_second) }
let!(:robot3) { FactoryBot.create(:robot) }
let!(:robot4) { FactoryBot.create(:robot, :with_shipment) }
background { visit root_path }
scenario 'send shipment' do
expect(page).to have_content('Ready to ship')
within '.qa-passed' do
click_button 'Add to shipment'
end
within '.factory-second' do
click_button 'Add to shipment'
end
within '.shipping-list' do
click_button 'Send shipment'
end
expect(page).to have_content("Robots #{robot1.id}, #{robot2.id} is shipped successfully.")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment