mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 19:08:10 -05:00
34 lines
557 B
Ruby
34 lines
557 B
Ruby
require 'spec_helper'
|
|
|
|
describe Report do
|
|
|
|
|
|
describe 'visits report' do
|
|
|
|
let(:report) { Report.find('visits') }
|
|
|
|
context "no visits" do
|
|
it "returns an empty report" do
|
|
report.data.should be_blank
|
|
end
|
|
end
|
|
|
|
context "with visits" do
|
|
let(:user) { Fabricate(:user) }
|
|
|
|
before do
|
|
user.user_visits.create(visited_at: 1.day.ago)
|
|
user.user_visits.create(visited_at: 2.days.ago)
|
|
end
|
|
|
|
it "returns a report with data" do
|
|
report.data.should be_present
|
|
end
|
|
|
|
end
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|