add top page

This commit is contained in:
Régis Hanol
2013-12-24 00:50:36 +01:00
parent b90e811825
commit 567d2bd23c
57 changed files with 532 additions and 324 deletions
+30
View File
@@ -0,0 +1,30 @@
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