<commit_before>require "spec_helper"

# https://docs.adyen.com/display/TD/HPP+payment+response
RSpec.describe Spree::AdyenRedirectController, type: :controller do
  include_context "mock adyen api", success: true

  let(:order) do
    create(
      :order_with_line_items,
      state: "payment",
      store: store
    )
  end

  let!(:store) { Spree::Store.default }
  let!(:gateway) { create :hpp_gateway }

  before do
    allow(controller).to receive(:check_signature)
  end

  describe "GET confirm" do
    subject(:action) { spree_get :confirm, params }

    let(:psp_reference) { "8813824003752247" }
    let(:payment_method) { "amex" }
    let(:merchantReturnData) { "#{order.guest_token}|#{gateway.id}" }
    let(:params) do<commit_msg>Create store in spec<commit_after>require "spec_helper"

# https://docs.adyen.com/display/TD/HPP+payment+response
RSpec.describe Spree::AdyenRedirectController, type: :controller do
  include_context "mock adyen api", success: true

  let(:order) do
    create(
      :order_with_line_items,
      state: "payment",
      store: store
    )
  end

  let!(:store) { create :store }
  let!(:gateway) { create :hpp_gateway }

  before do
    allow(controller).to receive(:check_signature)
  end

  describe "GET confirm" do
    subject(:action) { spree_get :confirm, params }

    let(:psp_reference) { "8813824003752247" }
    let(:payment_method) { "amex" }
    let(:merchantReturnData) { "#{order.guest_token}|#{gateway.id}" }
    let(:params) do
{'fraction_non_alphanumeric': 0.1353887399463807, 'fraction_numerical': 0.021447721179624665, 'mean_word_length': 4.043918918918919, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1689651', 'n_tokens_mistral': 535, 'n_tokens_neox': 502, 'n_words': 101}