<commit_before>require 'spec_helper'

describe "Parts", js: true do
  stub_authorization!

  let!(:tshirt) { create(:product, :name => "T-Shirt") }
  let!(:mug) { create(:product, :name => "Mug") }

  before do
    visit spree.admin_product_path(mug)
    check "product_can_be_part"
    click_on "Update"
  end

  it "add and remove parts" do
    visit spree.admin_product_path(tshirt)
    click_on "Parts"
    fill_in "searchtext", with: "Mug"

    within("#search_hits") { click_on "Select" }
    page.should have_content(mug.sku)

    within("#product_parts") { click_on "Remove" }
  end
end<commit_msg>Another attempt to fix the feature parts spec<commit_after>require 'spec_helper'

describe "Parts", js: true do
  stub_authorization!

  let!(:tshirt) { create(:product, :name => "T-Shirt") }
  let!(:mug) { create(:product, :name => "Mug") }

  before do
    visit spree.admin_product_path(mug)
    check "product_can_be_part"
    click_on "Update"
  end

  it "add and remove parts" do
    visit spree.admin_product_path(tshirt)
    click_on "Parts"
    fill_in "searchtext", with: mug.name

    within("#search_hits") { click_on "Select" }
    page.should have_content(mug.sku)

    within("#product_parts") { click_on "Remove" }
  end
end
{'fraction_non_alphanumeric': 0.132317562149158, 'fraction_numerical': 0.0, 'mean_word_length': 4.052631578947368, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5608692', 'n_tokens_mistral': 457, 'n_tokens_neox': 444, 'n_words': 104}