2019-04-29 20:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-27 22:27:38 -04:00
|
|
|
RSpec.describe Developer do
|
2016-07-27 20:14:06 -04:00
|
|
|
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
|