diff --git a/app/models/user.rb b/app/models/user.rb index ac6955fea..52ac19255 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -406,9 +406,9 @@ class User < ActiveRecord::Base def upload_limited_reason if created_at > 1.week.ago - "You cannot upload during your first week of registration" + "cannot upload during your first week of registration" elsif upload_limit <= 0 - "You can only upload #{upload_limit} posts a day" + "can only upload #{upload_limit} posts a day" else nil end diff --git a/config/locales/en.yml b/config/locales/en.yml index 81ab77e9d..068a2a37a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -28,4 +28,7 @@ en: user_id: "You" tag_subscription: creator: "You" - creator_id: "You" \ No newline at end of file + creator_id: "You" + upload: + uploader: "You" + uploader_id: "You" \ No newline at end of file diff --git a/test/unit/upload_test.rb b/test/unit/upload_test.rb index f08c45ab5..23a2ba1e8 100644 --- a/test/unit/upload_test.rb +++ b/test/unit/upload_test.rb @@ -22,6 +22,19 @@ class UploadTest < ActiveSupport::TestCase teardown do FileUtils.rm_f(Dir.glob("#{Rails.root}/tmp/test.*")) end + + context "from a user that is limited" do + setup do + CurrentUser.user = FactoryGirl.create(:user, :created_at => 1.year.ago) + User.any_instance.stubs(:upload_limit).returns(0) + end + + should "fail creation" do + @upload = FactoryGirl.build(:jpg_upload, :tag_string => "") + @upload.save + assert_equal(["You can only upload 0 posts a day"], @upload.errors.full_messages) + end + end context "that has incredibly absurd res dimensions" do setup do