mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
31 lines
462 B
Ruby
31 lines
462 B
Ruby
|
require 'spec_helper'
|
||
|
|
||
|
describe TopTopic do
|
||
|
|
||
|
it { should belong_to :topic }
|
||
|
|
||
|
context "refresh!" do
|
||
|
|
||
|
let!(:t1) { Fabricate(:topic) }
|
||
|
let!(:t2) { Fabricate(:topic) }
|
||
|
|
||
|
it "begins blank" do
|
||
|
TopTopic.all.should be_blank
|
||
|
end
|
||
|
|
||
|
context "after calculating" do
|
||
|
|
||
|
before do
|
||
|
TopTopic.refresh!
|
||
|
end
|
||
|
|
||
|
it "should have top topics" do
|
||
|
TopTopic.pluck(:topic_id).should =~ [t1.id, t2.id]
|
||
|
end
|
||
|
|
||
|
end
|
||
|
|
||
|
end
|
||
|
|
||
|
end
|