Sha256: eb051cbcd91d3cbffc7ba9f8168e5239eaee1cf766246e193c7420133d4c472b

Contents?: true

Size: 648 Bytes

Versions: 24

Compression:

Stored size: 648 Bytes

Contents

require 'test_helper'

class ApiClientTest < ActiveSupport::TestCase

  def setup
    @shop = disco_app_shops(:widget_store)
    stub_request(:post, "https://api.discolabs.com/v1/app_subscriptions.json").
        with(body: api_fixture('subscriptions/valid_request').to_json).
        to_return(status: 200, body: api_fixture('subscriptions/valid_request').to_json)
  end

  def teardown
    @shop = nil
    WebMock.reset!
  end

  test 'Successful disco api call render correct JSON' do
    response = @shop.disco_api_client.create_app_subscription
    assert_equal api_fixture('subscriptions/valid_request'), JSON.parse(response.body)
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
disco_app-0.16.1.pre.sidekiq.pre.6.pre.release test/clients/disco_app/api_client_test.rb
disco_app-0.12.5 test/clients/disco_app/api_client_test.rb
disco_app-0.12.6 test/clients/disco_app/api_client_test.rb
disco_app-0.12.7 test/clients/disco_app/api_client_test.rb
disco_app-0.13.0 test/clients/disco_app/api_client_test.rb
disco_app-0.13.1 test/clients/disco_app/api_client_test.rb
disco_app-0.13.2 test/clients/disco_app/api_client_test.rb
disco_app-0.13.3 test/clients/disco_app/api_client_test.rb
disco_app-0.13.4 test/clients/disco_app/api_client_test.rb
disco_app-0.13.5 test/clients/disco_app/api_client_test.rb
disco_app-0.13.6 test/clients/disco_app/api_client_test.rb
disco_app-0.13.7 test/clients/disco_app/api_client_test.rb
disco_app-0.13.8 test/clients/disco_app/api_client_test.rb
disco_app-0.14.1 test/clients/disco_app/api_client_test.rb
disco_app-0.14.2 test/clients/disco_app/api_client_test.rb
disco_app-0.15.0 test/clients/disco_app/api_client_test.rb
disco_app-0.16.0 test/clients/disco_app/api_client_test.rb
disco_app-0.14.4 test/clients/disco_app/api_client_test.rb
disco_app-0.14.3 test/clients/disco_app/api_client_test.rb
disco_app-0.16.1 test/clients/disco_app/api_client_test.rb