Sha256: 46119ac12f9b47f8ada092f6ee4807291f918be4ea7daa5573ad8fb341dd0b7b

Contents?: true

Size: 1.32 KB

Versions: 25

Compression:

Stored size: 1.32 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)
      find("#payment_#{payment.id} a").click
      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)
      find("#payment_#{payment.id} a").click
      click_link "Logs"
      within("#listing_log_entries") do
        expect(page).to have_content("Transaction failed")
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
solidus_backend-1.1.4 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-1.0.7 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.1.5 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.1.4 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.1.3 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.1.2 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.0.10 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.1.1 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.1.0 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.1.0.rc4 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.0.9 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.1.0.rc3 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.1.0.rc2 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.1.0.rc1 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-1.0.6 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.0.8 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.0.7 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-1.1.3 spec/features/admin/orders/log_entries_spec.rb
solidus_backend-1.0.5 spec/features/admin/orders/log_entries_spec.rb
spree_backend-3.0.6.1 spec/features/admin/orders/log_entries_spec.rb