Sha256: d65dc294ddf1d4f6b640f32cca4d9344ba67a7a6fc13380e1870903b5386bb2a

Contents?: true

Size: 1.23 KB

Versions: 14

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe "Log entries", type: :feature do
  stub_authorization!

  let!(:payment) { create(:payment) }

  context "with a successful log entry" do
    before do
      response = ActiveMerchant::Billing::Response.new(
        true,
        "Transaction successful",
        transid: "ABCD1234"
      )

      payment.log_entries.create(
        details: response.to_yaml
      )
    end

    it "shows a successful attempt" do
      visit spree.admin_order_payments_path(payment.order)
      click_on payment.number

      within("#listing_log_entries") do
        expect(page).to have_content("Transaction successful")
      end
    end
  end

  context "with a failed log entry" do
    before do
      response = ActiveMerchant::Billing::Response.new(
        false,
        "Transaction failed",
        transid: "ABCD1234"
      )

      payment.log_entries.create(
        source: payment.source,
        details: response.to_yaml
      )
    end

    it "shows a failed attempt" do
      visit spree.admin_order_payments_path(payment.order)
      click_on payment.number

      within("#listing_log_entries") do
        expect(page).to have_content("Transaction failed")
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
solidus_backend-2.10.5 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.10.3 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.10.2 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.9.6 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.10.1 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.9.5 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.10.0 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.9.4 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.9.3 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.9.2 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.10.0.beta1 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.9.1 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.9.0 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-2.9.0.rc.1 spec/features/admin/orders/log_entries_spec.rb