Fix RuboCop offense Rails/PluralizationGrammar (#39889).

git-svn-id: https://svn.redmine.org/redmine/trunk@22985 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2024-08-25 05:08:12 +00:00
parent 9c2bcfea29
commit b1767ab637
5 changed files with 9 additions and 9 deletions

View File

@@ -88,7 +88,7 @@ module Redmine
def to_html(format, text, options = {})
text =
if Setting.cache_formatted_text? && text.size > 2.kilobyte && cache_store &&
if Setting.cache_formatted_text? && text.size > 2.kilobytes && cache_store &&
cache_key = cache_key_for(format, text, options[:object], options[:attribute])
# Text retrieved from the cache store may be frozen
# We need to dup it so we can do in-place substitutions with gsub!

View File

@@ -201,7 +201,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest
def test_show_text_file_should_show_other_if_too_big
@request.session[:user_id] = 2
with_settings :file_max_size_displayed => 512 do
Attachment.find(4).update_attribute :filesize, 754.kilobyte
Attachment.find(4).update_attribute :filesize, 754.kilobytes
get(:show, :params => {:id => 4})
assert_response :success
assert_equal 'text/html', @response.media_type

View File

@@ -113,13 +113,13 @@ class AttachmentTest < ActiveSupport::TestCase
end
def test_filesize_greater_than_2gb_should_be_supported
with_settings :attachment_max_size => (50.gigabyte / 1024) do
with_settings :attachment_max_size => (50.gigabytes / 1024) do
a = Attachment.create!(:container => Issue.find(1),
:file => uploaded_test_file("testfile.txt", "text/plain"),
:author => User.find(1))
a.filesize = 20.gigabyte
a.filesize = 20.gigabytes
a.save!
assert_equal 20.gigabyte, a.reload.filesize
assert_equal 20.gigabytes, a.reload.filesize
end
end

View File

@@ -661,10 +661,10 @@ class ChangesetTest < ActiveSupport::TestCase
:committed_on => Time.now,
:revision => '123',
:scmid => '12345',
:comments => "a" * 500.kilobyte)
:comments => "a" * 500.kilobytes)
assert c.save
c.reload
assert_equal 500.kilobyte, c.comments.size
assert_equal 500.kilobytes, c.comments.size
end
def test_identifier

View File

@@ -120,10 +120,10 @@ class WikiContentTest < ActiveSupport::TestCase
def test_large_text_should_not_be_truncated_to_64k
page = WikiPage.new(:wiki => @wiki, :title => "Big page")
page.content = WikiContent.new(:text => "a" * 500.kilobyte, :author => User.find(1))
page.content = WikiContent.new(:text => "a" * 500.kilobytes, :author => User.find(1))
assert page.save
page.reload
assert_equal 500.kilobyte, page.content.text.size
assert_equal 500.kilobytes, page.content.text.size
end
def test_current_version