EDIT: specs and translation updated

This commit is contained in:
Jahan Gagan 2020-10-22 19:06:56 +05:30 committed by Robin Ward
parent fab67fafc1
commit cce03de616
2 changed files with 4 additions and 2 deletions

View File

@ -1815,7 +1815,7 @@ en:
min_trust_to_post_embedded_media: "The minimum trust level required to embed media items in a post"
min_trust_level_to_allow_profile_background: "The minimum trust level required to upload a profile background"
min_trust_level_to_allow_user_card_background: "The minimum trust level required to upload a user card background"
min_trust_level_to_allow_invite: "The minimum trust level required to allow invite"
min_trust_level_to_allow_invite: "The minimum trust level required to invite users"
allowed_link_domains: "Domains that users may link to even if they don't have the appropriate trust level to post links"
newuser_max_links: "How many links a new user can add to a post."

View File

@ -625,7 +625,7 @@ describe Guardian do
end
describe "private messages" do
SiteSetting.min_trust_level_to_allow_invite = 2
fab!(:user) { Fabricate(:user, trust_level: TrustLevel[2]) }
fab!(:user) { Fabricate(:user, trust_level: SiteSetting.min_trust_level_to_allow_invite) }
fab!(:pm) { Fabricate(:private_message_topic, user: user) }
@ -650,9 +650,11 @@ describe Guardian do
context "when private messages are enabled" do
before do
SiteSetting.enable_personal_messages = true
SiteSetting.min_trust_level_to_allow_invite = 2
end
it "returns true if user has sufficient trust level" do
user.trust_level = 2
expect(Guardian.new(user).can_invite_to?(pm)).to be_truthy
end