3 class ApiClientAuthorizationTest < ActiveSupport::TestCase
4 include CurrentApiClient
6 [:admin_trustedclient, :active_trustedclient].each do |token|
7 test "ApiClientAuthorization can be created then deleted by #{token}" do
8 set_user_from_auth token
9 x = ApiClientAuthorization.create!(user_id: current_user.id,
12 newtoken = x.api_token
13 assert x.destroy, "Failed to destroy new ApiClientAuth"
14 assert_empty ApiClientAuthorization.where(api_token: newtoken), "Destroyed ApiClientAuth is still in database"