authorization_spec.rb 575 B

12345678910111213141516
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Authorization, type: :model do
  4. subject(:authorization) { create(:twitter_authorization) }
  5. describe 'User assets' do
  6. it 'does update assets after new authorizations created' do
  7. authorization.user.assets({})
  8. create(:twitter_authorization, provider: 'twitter2', user: authorization.user)
  9. assets = authorization.user.reload.assets({})
  10. expect(assets[:User][authorization.user.id]['accounts'].keys.count).to eq(2)
  11. end
  12. end
  13. end