mirror of
https://github.com/discourse/discourse.git
synced 2026-08-07 13:19:19 +08:00
`promote_upcoming_changes_on_status` defaults to `beta`, so promoting the change makes the redesigned dashboard the default everywhere, including in the test environment. Specs covering the legacy dashboard now opt out explicitly with `SiteSetting.dashboard_improvements = false`.
23 lines
704 B
Ruby
Vendored
23 lines
704 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
describe "Admin Dashboard General Tab" do
|
|
fab!(:admin)
|
|
fab!(:user)
|
|
fab!(:user_visit) { Fabricate(:user_visit, user: admin) }
|
|
fab!(:user_visit_2) { Fabricate(:user_visit, user: user, mobile: true) }
|
|
fab!(:user_visit_3) { Fabricate(:user_visit, user: user, visited_at: 1.day.ago) }
|
|
|
|
before do
|
|
SiteSetting.dashboard_improvements = false
|
|
sign_in(admin)
|
|
end
|
|
|
|
it "displays correct visit counters combining desktop and mobile visits" do
|
|
visit("/admin")
|
|
|
|
within ".admin-report.visits .admin-report-counters" do
|
|
expect(page).to have_css(".today-count", text: "2")
|
|
expect(page).to have_css(".yesterday-count", text: "1")
|
|
end
|
|
end
|
|
end
|