mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:01:18 +08:00
FEATURE: allow "developer" account flagging via developers table
This mechanism for flagging developer accounts will eventually replace DISCOURSE_DEVELOPER_EMAILS
This commit is contained in:
20
spec/models/developer_spec.rb
Normal file
20
spec/models/developer_spec.rb
Normal file
@ -0,0 +1,20 @@
|
||||
require 'rails_helper'
|
||||
|
||||
describe Developer do
|
||||
it "can correctly flag developer accounts" do
|
||||
user = Fabricate(:user)
|
||||
guardian = Guardian.new(user)
|
||||
|
||||
expect(guardian.is_developer?).to eq(false)
|
||||
|
||||
Developer.create!(user_id: user.id)
|
||||
|
||||
# not an admin so not a developer yet
|
||||
expect(guardian.is_developer?).to eq(false)
|
||||
|
||||
user.update_columns(admin: true)
|
||||
|
||||
expect(guardian.is_developer?).to eq(true)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user