DEV: Refactor API key specs to avoid hard-coding keys

By hard-coding keys, we are not testing the API key system end to end. This change also makes the specs more resilient to upcoming API key changes
This commit is contained in:
David Taylor
2019-11-29 15:16:06 +00:00
parent 7fee3c61de
commit a6aada16bd
5 changed files with 61 additions and 64 deletions

View File

@ -56,7 +56,7 @@ describe 'rate limiter integration' do
#request.set_header("action_dispatch.show_exceptions", true)
admin = Fabricate(:admin)
api_key = Fabricate(:api_key, key: SecureRandom.hex, user: admin)
api_key = Fabricate(:api_key, user: admin)
global_setting :max_admin_api_reqs_per_key_per_minute, 1