Sha256: 351c94110867e9f13a191fdbe0cc652cf4e5cd4841820450c720a7abdf556a04

Contents?: true

Size: 731 Bytes

Versions: 3

Compression:

Stored size: 731 Bytes

Contents

require 'spec_helper'

RSpec.describe SolidusPaypalBraintree::BraintreeAdminHelper do
  describe '#braintree_transaction_link' do
    subject { helper.braintree_transaction_link(payment) }

    let(:payment_method) { create_gateway }
    let(:payment) do
      instance_double(Spree::Payment, payment_method: payment_method, response_code: 'abcde')
    end
    let(:merchant_id) { payment_method.preferences[:merchant_id] }

    it 'generates a link to Braintree admin' do
      expect(subject).to eq "<a title=\"Show payment on Braintree\" target=\"_blank\" rel=\"noopener\" href=\"https://sandbox.braintreegateway.com/merchants/#{merchant_id}/transactions/abcde\">abcde</a>" # rubocop:disable Layout/LineLength
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_paypal_braintree-1.2.0 spec/helpers/solidus_paypal_braintree/braintree_admin_helper_spec.rb
solidus_paypal_braintree-1.1.0 spec/helpers/solidus_paypal_braintree/braintree_admin_helper_spec.rb
solidus_paypal_braintree-1.0.0 spec/helpers/solidus_paypal_braintree/braintree_admin_helper_spec.rb