mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 05:53:52 +08:00
Upgrade rspec to 3.4.0.
This commit is contained in:
@ -613,7 +613,10 @@ class User < ActiveRecord::Base
|
||||
# Use this helper to determine if the user has a particular trust level.
|
||||
# Takes into account admin, etc.
|
||||
def has_trust_level?(level)
|
||||
raise "Invalid trust level #{level}" unless TrustLevel.valid?(level)
|
||||
unless TrustLevel.valid?(level)
|
||||
raise InvalidTrustLevel.new("Invalid trust level #{level}")
|
||||
end
|
||||
|
||||
admin? || moderator? || staged? || TrustLevel.compare(trust_level, level)
|
||||
end
|
||||
|
||||
@ -907,7 +910,7 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def hash_password(password, salt)
|
||||
raise "password is too long" if password.size > User.max_password_length
|
||||
raise StandardError.new("password is too long") if password.size > User.max_password_length
|
||||
Pbkdf2.hash_password(password, salt, Rails.configuration.pbkdf2_iterations, Rails.configuration.pbkdf2_algorithm)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user