mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-04-30 03:46:52 +08:00
This commit redirects the new site traffic report URL to the legacy one on sites where `use_legacy_pageviews = true`. - New URL: /admin/reports/site_traffic - Legacy URL: /admin/reports/consolidated_page_views
24 lines
762 B
Ruby
24 lines
762 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "Admin Reports", type: :system do
|
|
fab!(:current_user, :admin)
|
|
before { sign_in(current_user) }
|
|
|
|
context "when use_legacy_pageviews is true" do
|
|
before { SiteSetting.use_legacy_pageviews = true }
|
|
|
|
it "redirects from site_traffic to consolidated_page_views" do
|
|
visit "/admin/reports/site_traffic"
|
|
expect(page).to have_current_path("/admin/reports/consolidated_page_views")
|
|
end
|
|
end
|
|
|
|
context "when use_legacy_pageviews is false" do
|
|
before { SiteSetting.use_legacy_pageviews = false }
|
|
|
|
it "won't redirects from site_traffic to consolidated_page_views" do
|
|
visit "/admin/reports/site_traffic"
|
|
expect(page).to have_current_path("/admin/reports/site_traffic")
|
|
end
|
|
end
|
|
end
|