mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 20:22:45 +08:00
FIX: today visits not shown
This commit is contained in:
parent
b48f04e772
commit
fe7f2c6979
|
@ -46,7 +46,7 @@ class Report
|
|||
end
|
||||
|
||||
def self.report_visits(report)
|
||||
basic_report_about report, UserVisit, :by_day, report.start_date, report.end_date
|
||||
basic_report_about report, UserVisit, :by_day, report.start_date, report.end_date.change(hour: 24)
|
||||
end
|
||||
|
||||
def self.report_signups(report)
|
||||
|
|
|
@ -15,6 +15,7 @@ describe Report do
|
|||
let(:user) { Fabricate(:user) }
|
||||
|
||||
before do
|
||||
user.user_visits.create(visited_at: 1.hour.ago)
|
||||
user.user_visits.create(visited_at: 1.day.ago)
|
||||
user.user_visits.create(visited_at: 2.days.ago)
|
||||
end
|
||||
|
@ -22,6 +23,10 @@ describe Report do
|
|||
it "returns a report with data" do
|
||||
report.data.should be_present
|
||||
end
|
||||
|
||||
it "return today's visit" do
|
||||
report.data.select { |v| v[:x].today? }.should be_present
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user