<commit_before># frozen_string_literal: true

require 'spec_helper'

feature '
    As an administrator
    I want to create/update complex order cycles with a specific time
', js: true do
  include AdminHelper
  include AuthenticationHelper
  include WebHelper

  let(:order_cycle_opening_time) { Time.zone.local(2040, 11, 0o6, 0o6, 0o0, 0o0) }
  let(:order_cycle_closing_time) { Time.zone.local(2040, 11, 13, 17, 0o0, 0o0) }

  scenario "creating an order cycle with full interface", js: true do
    # Given coordinating, supplying and distributing enterprises with some products with variants
    coordinator = create(:distributor_enterprise, name: 'My coordinator')
    supplier = create(:supplier_enterprise, name: 'My supplier')
    product = create(:product, supplier: supplier)
    v1 = create(:variant, product: product)
    v2 = create(:variant, product: product)
    distributor = create(:distributor_enterprise, name: 'My distributor',
                                                  with_payment_and_shipping: true)

    # Relationships required for interface to work
    create(:enterprise_relationship, parent: supplier, child: coordinator,
                                     permissions_list: [:add_to_order_cycle])
    create(:enterprise_relationship, parent: distributor, child: coordinator,<commit_msg>Sets OC-times in relation to the Zone time<commit_after># frozen_string_literal: true

require 'spec_helper'

feature '
    As an administrator
    I want to create/update complex order cycles with a specific time
', js: true do
  include AdminHelper
  include AuthenticationHelper
  include WebHelper

  let(:order_cycle_opening_time) { 1.day.from_now(Time.zone.now) }
  let(:order_cycle_closing_time) { 2.day.from_now(Time.zone.now) }

  scenario "creating an order cycle with full interface", js: true do
    # Given coordinating, supplying and distributing enterprises with some products with variants
    coordinator = create(:distributor_enterprise, name: '<NAME>')
    supplier = create(:supplier_enterprise, name: 'My supplier')
    product = create(:product, supplier: supplier)
    v1 = create(:variant, product: product)
    v2 = create(:variant, product: product)
    distributor = create(:distributor_enterprise, name: 'My distributor',
                                                  with_payment_and_shipping: true)

    # Relationships required for interface to work
    create(:enterprise_relationship, parent: supplier, child: coordinator,
                                     permissions_list: [:add_to_order_cycle])
    create(:enterprise_relationship, parent: distributor, child: coordinator,
{'fraction_non_alphanumeric': 0.08222811671087533, 'fraction_numerical': 0.012883668056081848, 'mean_word_length': 3.664310954063604, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4556880', 'n_tokens_mistral': 746, 'n_tokens_neox': 687, 'n_words': 219}