A platform for community discussion. Free, open, simple.
fix narrative bot spec to include base_uri key in translations
Neil Lalondea530606da730
diff --git a/plugins/discourse-narrative-bot/spec/user_spec.rb b/plugins/discourse-narrative-bot/spec/user_spec.rbindex 216e2d66fcc..9779c2414fa 100644--- a/plugins/discourse-narrative-bot/spec/user_spec.rb+++ b/plugins/discourse-narrative-bot/spec/user_spec.rb@@ -4,6 +4,14 @@ describe User dolet(:user) { Fabricate(:user) }let(:profile_page_url) { "#{Discourse.base_url}/users/#{user.username}" }+ def i18n_post_args(extra = {})+ { base_uri: "" }.merge(extra)+ end++ def i18n_t(key, params = {})+ I18n.t(key, i18n_post_args.merge(params))+ end+before doSiteSetting.queue_jobs = falseSiteSetting.discourse_narrative_bot_enabled = true@@ -15,7 +23,7 @@ describe User douser- expected_raw = I18n.t('discourse_narrative_bot.new_user_narrative.hello.message',+ expected_raw = i18n_t('discourse_narrative_bot.new_user_narrative.hello.message',username: user.username, title: SiteSetting.title)@@ -42,7 +50,7 @@ describe User doit 'initiates the bot' doexpect { user }.to change { Topic.count }.by(1)- expect(Topic.last.title).to eq(I18n.t(+ expect(Topic.last.title).to eq(i18n_t('discourse_narrative_bot.new_user_narrative.hello.title').gsub(/:robot:/, '').strip)end@@ -56,7 +64,7 @@ describe User doit 'initiate the bot' doexpect { user }.to change { Topic.count }.by(1)- expect(Topic.last.title).to eq(I18n.t(+ expect(Topic.last.title).to eq(i18n_t('discourse_narrative_bot.new_user_narrative.hello.title'))end@@ -69,7 +77,7 @@ describe User doit 'should send the right welcome message' doexpect { user }.to change { Topic.count }.by(1)- expect(Topic.last.title).to eq(I18n.t(+ expect(Topic.last.title).to eq(i18n_t("system_messages.welcome_user.subject_template",site_name: SiteSetting.title))