mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 19:42:32 -05:00
35 lines
557 B
Ruby
35 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
|