Add missing event name translations

We were always displaying the event names in English.

Note we're changing the `user_supported_budgets` key because it didn't
make much sense; the investments are supported, and not the budgets.

We're also adding "created" to most of the event names in order to make
the texts more explicit, since not all the events refer to created data.
This commit is contained in:
Javi Martín
2024-04-25 03:44:09 +02:00
parent 328413373e
commit d25f2e7259
8 changed files with 32 additions and 28 deletions

View File

@@ -10,8 +10,8 @@ describe Admin::Stats::EventLinksComponent do
expect(page).to have_link count: 2
page.find("ul") do |list|
expect(list).to have_link "Legislation Annotation Created"
expect(list).to have_link "Legislation Answer Created"
expect(list).to have_link "Legislation annotations created"
expect(list).to have_link "Legislation answers created"
end
end
end

View File

@@ -29,7 +29,7 @@ describe Admin::Api::StatsController, :admin do
get :show, params: { event: "proposal_created" }
expect(response).to be_ok
expect(response.parsed_body).to eq "x" => ["2015-01-01", "2015-01-02"], "Citizen proposals" => [2, 1]
expect(response.parsed_body).to eq "x" => ["2015-01-01", "2015-01-02"], "Citizen proposals created" => [2, 1]
end
end
end

View File

@@ -21,7 +21,8 @@ describe Ahoy::Chart do
chart = Ahoy::Chart.new(:proposal_created)
expect(chart.data_points).to eq x: ["2015-01-01", "2015-01-02"], "Citizen proposals" => [2, 1]
expect(chart.data_points).to eq x: ["2015-01-01", "2015-01-02"],
"Citizen proposals created" => [2, 1]
end
it "accepts strings as the event name" do
@@ -30,7 +31,7 @@ describe Ahoy::Chart do
chart = Ahoy::Chart.new("proposal_created")
expect(chart.data_points).to eq x: ["2015-01-01"], "Citizen proposals" => [1]
expect(chart.data_points).to eq x: ["2015-01-01"], "Citizen proposals created" => [1]
end
it "returns visits data for the visits event" do
@@ -46,7 +47,7 @@ describe Ahoy::Chart do
expect(chart.data_points).to eq x: ["2015-01-01", "2015-01-02"], "Visits" => [2, 1]
end
it "returns user supports for the user_supported_budgets event" do
it "returns user supports for the budget_investment_supported event" do
time_1 = Time.zone.local(2017, 04, 01)
time_2 = Time.zone.local(2017, 04, 02)
@@ -55,9 +56,10 @@ describe Ahoy::Chart do
create(:vote, votable: create(:budget_investment), created_at: time_2)
create(:vote, votable: create(:proposal), created_at: time_2)
chart = Ahoy::Chart.new(:user_supported_budgets)
chart = Ahoy::Chart.new(:budget_investment_supported)
expect(chart.data_points).to eq x: ["2017-04-01", "2017-04-02"], "User Supported Budgets" => [1, 2]
expect(chart.data_points).to eq x: ["2017-04-01", "2017-04-02"],
"Budget investments supported" => [1, 2]
end
it "returns level three verified dates for the level_3_user event" do
@@ -70,7 +72,7 @@ describe Ahoy::Chart do
chart = Ahoy::Chart.new(:level_3_user)
expect(chart.data_points).to eq x: ["2001-01-02"], "Level 3 users" => [2]
expect(chart.data_points).to eq x: ["2001-01-02"], "Level 3 users verified" => [2]
end
end
end

View File

@@ -145,10 +145,10 @@ describe "Stats", :admin do
visit admin_stats_path
within("#stats") do
click_link "Debates"
click_link "Debates created"
end
expect(page).to have_content "Debates (1)"
expect(page).to have_content "Debates created (1)"
within("#graph") do
expect(page).to have_content Date.current.strftime("%Y-%m-%d")
@@ -159,9 +159,9 @@ describe "Stats", :admin do
create(:user, :level_three)
visit admin_stats_path
click_link "Level 3 users"
click_link "Level 3 users verified"
expect(page).to have_content "Level 3 users (1)"
expect(page).to have_content "Level 3 users verified (1)"
within("#graph") do
expect(page).to have_content Date.current.strftime("%Y-%m-%d")