Move feature spec to controller spec

It reduces the runtime (3s instead of 10s).
This commit is contained in:
Maikel Linke
2019-04-04 17:01:17 +11:00
parent 7b116c0982
commit 84501b9e41
2 changed files with 17 additions and 13 deletions

View File

@@ -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

View File

@@ -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'