Sha256: a39280335d5264e599ef0b5fc04866cda6f458de5e9cf7c5e2b1a6ccbc5f516f

Contents?: true

Size: 701 Bytes

Versions: 7

Compression:

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

7 entries across 7 versions & 1 rubygems

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