Sha256: a11d2732a9c3135c6af8699bad10ae0e626b2194e2ca1ec659a0461473bbd7e7

Contents?: true

Size: 779 Bytes

Versions: 15

Compression:

Stored size: 779 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_equal 'Nowhere', @shop.data[:country_name] # Assert extended method called.
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
disco_app-0.16.1.pre.sidekiq.pre.6.pre.release test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.13.5 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.13.6 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.13.7 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.13.8 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.14.1 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.14.2 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.15.0 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.16.0 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.14.4 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.14.3 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.16.1 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.15.2 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.14.0 test/jobs/disco_app/app_uninstalled_job_test.rb
disco_app-0.13.6.pre.puma.pre.3 test/jobs/disco_app/app_uninstalled_job_test.rb