Sha256: ecd42718ea1b62c96eda1d030aacfdb226dc296050992c19c4ed6f02a4448013

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

require 'spec_helper'

RSpec.describe SolidusBraintree::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

2 entries across 2 versions & 2 rubygems

Version Path
solidus_paypal_braintree-2.0.0 spec/helpers/solidus_paypal_braintree/braintree_admin_helper_spec.rb
solidus_braintree-2.0.0 spec/helpers/solidus_braintree/braintree_admin_helper_spec.rb