Sha256: 0ffdc6ff96479d9b134881e7db702ada70f917f9b3cf2f6f7e8608bcb7379291

Contents?: true

Size: 902 Bytes

Versions: 2

Compression:

Stored size: 902 Bytes

Contents

require 'spec_helper'

describe Spree::Api::OrdersController, type: :request do
  stub_authorization!

  describe 'get show' do
    let(:gateway) { create_gateway }
    let(:order) { create(:order_with_line_items) }
    let(:source) do
      SolidusBraintree::Source.new(
        nonce: 'fake-valid-nonce',
        user: order.user,
        payment_type: SolidusBraintree::Source::PAYPAL,
        payment_method: gateway
      )
    end

    context 'when using braintree as the payment' do
      before do
        allow_any_instance_of(Spree::Payment).to receive(:create_payment_profile).and_return(true)

        order.payments.create!(
          payment_method: gateway,
          source: source,
          amount: 55
        )
      end

      it "can be rendered correctly" do
        get "/api/orders/#{order.number}"

        expect(response).to have_http_status :ok
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
solidus_paypal_braintree-2.0.0 spec/requests/spree/api/orders_controller_spec.rb
solidus_braintree-2.0.0 spec/requests/spree/api/orders_controller_spec.rb