From 82b307cd52e86f2d295793ed8d5e9387f505d9b4 Mon Sep 17 00:00:00 2001 From: Dan Ungureanu Date: Mon, 17 Feb 2020 13:46:14 +0200 Subject: [PATCH] FIX: Use correct translation string --- plugins/poll/plugin.rb | 2 +- plugins/poll/spec/controllers/polls_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rb index d1b54eeeeb7..bf5163295b2 100644 --- a/plugins/poll/plugin.rb +++ b/plugins/poll/plugin.rb @@ -75,7 +75,7 @@ after_initialize do poll_groups = poll.groups.split(",").map(&:downcase) user_groups = user.groups.map { |g| g.name.downcase } if (poll_groups & user_groups).empty? - raise StandardError.new I18n.t("js.poll.results.groups.title", group: poll.groups) + raise StandardError.new I18n.t("js.poll.results.groups.title", groups: poll.groups) end end diff --git a/plugins/poll/spec/controllers/polls_controller_spec.rb b/plugins/poll/spec/controllers/polls_controller_spec.rb index 4236e6c51d2..74f15824f2d 100644 --- a/plugins/poll/spec/controllers/polls_controller_spec.rb +++ b/plugins/poll/spec/controllers/polls_controller_spec.rb @@ -195,7 +195,7 @@ describe ::DiscoursePoll::PollsController do expect(response.status).not_to eq(200) json = ::JSON.parse(response.body) - expect(json["errors"][0]).to eq(I18n.t("js.poll.results.groups.title", trust_level: 2)) + expect(json["errors"][0]).to eq(I18n.t("js.poll.results.groups.title", groups: poll.polls.first.groups)) end it "doesn't discard anonymous votes when someone votes" do