Sha256: 386a53f8eee5eb2430e365c05cccb090da7e0f52a4596d05f68642784b3fe886
Contents?: true
Size: 1.1 KB
Versions: 5
Compression:
Stored size: 1.1 KB
Contents
# frozen_string_literal: true require 'test_helper' class Custom::RefreshTokenControllerTest < ActionDispatch::IntegrationTest describe Custom::RefreshTokenController do include CustomControllersRoutes before do @resource = create(:user, :confirmed) @auth_headers = get_cookie_header(DeviseJwtAuth.refresh_token_name, @resource.create_refresh_token) end test 'yield resource to block on refresh_token success' do get '/nice_user_auth/refresh_token', params: {}, headers: @auth_headers assert @controller.refresh_token_block_called?, 'refresh_token failed to yield resource to provided block' end test 'yield resource to block on refresh_token success with custom json' do get '/nice_user_auth/refresh_token', params: {}, headers: @auth_headers @data = JSON.parse(response.body) assert @controller.refresh_token_block_called?, 'refresh_token failed to yield resource to provided block' assert_equal @data['custom'], 'foo' end end end
Version data entries
5 entries across 5 versions & 3 rubygems