Skip to content

Commit

Permalink
Add spec for selecting admin only shipping method
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Jan 11, 2018
1 parent 14ca07d commit 3239735
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions backend/spec/features/admin/orders/order_details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,24 @@
expect(page).to have_content("UPS Ground")
end

it "can use admin-only shipping methods" do
create(:shipping_method, name: "Admin Free Shipping", cost: 0, available_to_users: false)

visit spree.edit_admin_order_path(order)

screenshot_and_open_image

within("tr", text: "Shipping Method") do
click_icon :edit
select "Admin Free Shipping $0.00"
click_icon :check
end

expect(page).not_to have_css('#selected_shipping_rate_id')
expect(page).to have_no_content("UPS Ground")
expect(page).to have_content("Admin Free Shipping")
end

it "will show the variant sku" do
visit spree.edit_admin_order_path(order)
sku = order.line_items.first.variant.sku
Expand Down

0 comments on commit 3239735

Please sign in to comment.