added a reverse index of user uploads + rake task

This commit is contained in:
Régis Hanol
2013-06-13 01:43:50 +02:00
parent 77b218a142
commit 770c1faeb1
6 changed files with 57 additions and 2 deletions

View File

@ -26,6 +26,8 @@ describe Post do
it { should have_many :post_replies }
it { should have_many :replies }
it { should have_and_belong_to_many :upload }
it { should rate_limit }
let(:topic) { Fabricate(:topic) }

View File

@ -5,6 +5,8 @@ describe Upload do
it { should belong_to :user }
it { should belong_to :topic }
it { should have_and_belong_to_many :post }
it { should validate_presence_of :original_filename }
it { should validate_presence_of :filesize }
@ -38,7 +40,7 @@ describe Upload do
end
context "s3" do
before(:each) do
before(:each) do
SiteSetting.stubs(:enable_s3_uploads?).returns(true)
S3.stubs(:store_file).returns(url)
end