Sha256: 08b937273feb110a7be788753a4fdf96d495ef094e07e985af8171f886583786

Contents?: true

Size: 700 Bytes

Versions: 14

Compression:

Stored size: 700 Bytes

Contents

require 'test_helper'

class DiscoApp::SynchroniseUsersJobTest < ActionController::TestCase
  include ActiveJob::TestHelper

  def setup
    @shop = disco_app_shops(:widget_store)
    stub_request(:get, "#{@shop.admin_url}/users.json").to_return(status: 200, body: api_fixture('widget_store/users').to_json)
  end

  def teardown
    @shop = nil
    WebMock.reset!
  end

  test 'Successfully synchronise users via background job' do
    perform_enqueued_jobs do
      DiscoApp::SynchroniseUsersJob.perform_later(@shop)
    end
    user = DiscoApp::User.first
    assert_equal 'Steve', user.first_name
    assert_equal 'Jobs', user.last_name
    assert_equal 'steve@apple.com', user.email
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

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