Sha256: 6e9dcd5fa4b5744418751babcee582abf37e21c688f8b2d37d355329bceb904e

Contents?: true

Size: 785 Bytes

Versions: 7

Compression:

Stored size: 785 Bytes

Contents

require 'test_helper'

class DiscoApp::AppUninstalledJobTest < 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)
    perform_enqueued_jobs do
      DiscoApp::AppUninstalledJob.perform_later(@shop, {})
    end
  end

  def teardown
    @shop = nil
    WebMock.reset!
  end

  test 'app uninstalled job changes shop status' do
    assert_performed_jobs 2
    @shop.reload
    assert @shop.uninstalled?
  end

  test 'app uninstalled job can be extended using concerns' do
    assert_performed_jobs 2
    @shop.reload
    # Assert extended method called.
    assert_equal 'Nowhere', @shop.data[:country_name]
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

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