Sha256: 5cd7e5756723ceb120d20da4aab4e9527a0ad7169bb56aea765c5cf1493aced8

Contents?: true

Size: 606 Bytes

Versions: 7

Compression:

Stored size: 606 Bytes

Contents

require 'test_helper'

class DiscoApp::SendSubscriptionJobTest < ActionController::TestCase

  include ActiveJob::TestHelper

  def setup
    @shop = disco_app_shops(:widget_store)
    stub_request(:post, 'https://api.discolabs.com/v1/app_subscriptions.json').to_return(status: 200)
  end

  def teardown
    @shop = nil

    WebMock.reset!
  end

  test 'subscription job correctly sends request to API' do
    perform_enqueued_jobs do
      DiscoApp::SendSubscriptionJob.perform_later(@shop)
    end
    assert_requested(:post, 'https://api.discolabs.com/v1/app_subscriptions.json', times: 1)
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
disco_app-0.17.0 test/jobs/disco_app/send_subscription_job_test.rb
disco_app-0.18.0 test/jobs/disco_app/send_subscription_job_test.rb
disco_app-0.18.2 test/jobs/disco_app/send_subscription_job_test.rb
disco_app-0.18.3 test/jobs/disco_app/send_subscription_job_test.rb
disco_app-0.18.6 test/jobs/disco_app/send_subscription_job_test.rb
disco_app-0.18.4 test/jobs/disco_app/send_subscription_job_test.rb
disco_app-0.18.1 test/jobs/disco_app/send_subscription_job_test.rb