Sha256: b306854d563354e89ff743da90813cd91d8226725d344d71465ef41118939f73

Contents?: true

Size: 975 Bytes

Versions: 17

Compression:

Stored size: 975 Bytes

Contents

require 'spec_helper'

feature 'Promotion with product rule', js: true do
  stub_authorization!

  given!(:product) { create :product, name: "BlamCo Mac & Cheese", sku: "PRODUCT_SKU" }
  given!(:variant) { create :variant, sku: "VARIANT_SKU", product: product }
  given!(:option_value) { variant.option_values.first }

  given(:promotion) { create :promotion }

  def add_promotion_rule_of_type(type)
    select type, from: "Add rule of type"
    within("#rules_container") { click_button "Add" }
  end

  background do
    visit spree.edit_admin_promotion_path(promotion)
    add_promotion_rule_of_type("Product(s)")
  end

  it "can select by product sku" do
    select2_search product.name, from: "Choose products", search: "PRODUCT_SKU"
  end

  it "can select by variant sku" do
    select2_search product.name, from: "Choose products", search: "VARIANT_SKU"
  end

  it "can select by product name" do
    select2_search product.name, from: "Choose products"
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
solidus_backend-2.5.2 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.5.1 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.5.0 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.5.0.rc1 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.5.0.beta2 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.5.0.beta1 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.4.2 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.4.1 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.3.1 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.4.0 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.4.0.rc1 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.4.0.beta1 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.3.0 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.3.0.rc3 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.3.0.rc2 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.3.0.rc1 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend-2.3.0.beta1 spec/features/admin/promotions/product_rule_spec.rb