From cce03de61646edee1c78c3642b77955e0608948d Mon Sep 17 00:00:00 2001 From: Jahan Gagan Date: Thu, 22 Oct 2020 19:06:56 +0530 Subject: [PATCH] EDIT: specs and translation updated --- config/locales/server.en.yml | 2 +- spec/components/guardian_spec.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index c3b878df36e..b6a95a4e0c1 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -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." diff --git a/spec/components/guardian_spec.rb b/spec/components/guardian_spec.rb index 2b5afbc4b8f..b438054bfbc 100644 --- a/spec/components/guardian_spec.rb +++ b/spec/components/guardian_spec.rb @@ -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