mirror of
https://github.com/discourse/discourse-rewind.git
synced 2025-12-11 10:05:32 +00:00
This was confusing people last year, most people assumed it meant the tags they used the most / categories they posted in the most. This should clear things up. Also removes the `isRewindActive` function in favour of `is_rewind_active` on the current user, since then we only have one place to check this, and it makes testing easier since we don't have to mock browser time. Finally it moves the route for rewind in the UI to the new route path format.
41 lines
899 B
Ruby
41 lines
899 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe "DiscourseRewind | rewind tab", type: :system do
|
|
fab!(:current_user, :user)
|
|
|
|
before do
|
|
SiteSetting.discourse_rewind_enabled = true
|
|
sign_in(current_user)
|
|
end
|
|
|
|
context "when in january" do
|
|
before { freeze_time DateTime.parse("2022-01-10") }
|
|
|
|
it "shows the tab" do
|
|
visit("/my/activity")
|
|
|
|
expect(page).to have_selector(".user-nav__activity-rewind")
|
|
end
|
|
end
|
|
|
|
context "when in december" do
|
|
before { freeze_time DateTime.parse("2022-12-05") }
|
|
|
|
it "shows the tab" do
|
|
visit("/my/activity")
|
|
|
|
expect(page).to have_selector(".user-nav__activity-rewind")
|
|
end
|
|
end
|
|
|
|
context "when in november" do
|
|
before { freeze_time DateTime.parse("2022-11-24") }
|
|
|
|
it "doesn't show the tab" do
|
|
visit("/my/activity")
|
|
|
|
expect(page).to have_no_selector(".user-nav__activity-rewind")
|
|
end
|
|
end
|
|
end
|