Sha256: 812c3e9b86e7b645ee37423f03218bc8c3fbc5e9b4b2c5d7b59cf0b02e7cef4c

Contents?: true

Size: 1004 Bytes

Versions: 13

Compression:

Stored size: 1004 Bytes

Contents

# frozen_string_literal: true

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: "Discount rules"
    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

13 entries across 13 versions & 1 rubygems

Version Path
solidus_backend_devise_token_auth-2.8.0.alpha.14 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.13 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.12 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.11 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.10 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.9 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.8 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.7 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.6 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.5 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.4 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.3 spec/features/admin/promotions/product_rule_spec.rb
solidus_backend_devise_token_auth-2.8.0.alpha.2 spec/features/admin/promotions/product_rule_spec.rb