mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Move feature spec to controller spec
It reduces the runtime (3s instead of 10s).
This commit is contained in:
@@ -14,6 +14,23 @@ describe Spree::Admin::OrdersController, type: :controller do
|
||||
spree_get :edit, id: order
|
||||
}.to change { order.reload.state }.from("cart").to("complete")
|
||||
end
|
||||
|
||||
describe "view" do
|
||||
render_views
|
||||
|
||||
it "shows only eligible adjustments" do
|
||||
adjustment = create(
|
||||
:adjustment,
|
||||
adjustable: order,
|
||||
label: "invalid adjustment",
|
||||
amount: 0
|
||||
)
|
||||
|
||||
spree_get :edit, id: order
|
||||
|
||||
expect(response.body).to_not match adjustment.label
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "#update" do
|
||||
|
||||
@@ -282,19 +282,6 @@ feature %q{
|
||||
end
|
||||
end
|
||||
|
||||
scenario "shows only eligible adjustments" do
|
||||
adjustment = create(
|
||||
:adjustment,
|
||||
adjustable: @order,
|
||||
label: "invalid adjustment",
|
||||
amount: 0
|
||||
)
|
||||
|
||||
visit spree.edit_admin_order_path(@order)
|
||||
|
||||
expect(page).to have_no_content adjustment.label
|
||||
end
|
||||
|
||||
scenario "cannot split the order in different stock locations" do
|
||||
# There's only 1 stock location in OFN, so the split functionality that comes with spree should be hidden
|
||||
expect(page).to_not have_selector '.split-item'
|
||||
|
||||
Reference in New Issue
Block a user