Sha256: 7499875d41b862db58e3e719d900a96b4c81662e041ff8a0d828f91ef64861d8

Contents?: true

Size: 1.29 KB

Versions: 7

Compression:

Stored size: 1.29 KB

Contents

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(
        :source => payment.source,
        :details => response.to_yaml
      )
    end

    it "shows a successful attempt" do
      visit spree.admin_order_payments_path(payment.order)
      click_on payment.number
      click_link "Logs"
      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
      click_link "Logs"
      within("#listing_log_entries") do
        expect(page).to have_content("Transaction failed")
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solidus_backend-1.2.3 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-1.2.2 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-1.2.1 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-1.2.0 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-1.2.0.rc2 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-1.2.0.rc1 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-1.2.0.beta1 spec/features/admin/orders/log_entries_spec.rb