Sha256: 9eb03a2aac496a49e27f71ddb994d6a890c2b5c5062265c58de538b3004024f5

Contents?: true

Size: 605 Bytes

Versions: 24

Compression:

Stored size: 605 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

24 entries across 24 versions & 1 rubygems

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