mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
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:
@ -781,7 +781,7 @@ describe PostsController do
|
||||
|
||||
it 'prevents whispers for regular users' do
|
||||
post_1 = Fabricate(:post)
|
||||
user_key = ApiKey.create!(user: user, key: SecureRandom.hex).key
|
||||
user_key = ApiKey.create!(user: user).key
|
||||
|
||||
post "/posts.json", params: {
|
||||
api_username: user.username,
|
||||
|
Reference in New Issue
Block a user