summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/helpers/storage_helper_spec.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/helpers/storage_helper_spec.rb b/spec/helpers/storage_helper_spec.rb
index 4627a1e1872..aa9ff5f8db7 100644
--- a/spec/helpers/storage_helper_spec.rb
+++ b/spec/helpers/storage_helper_spec.rb
@@ -14,8 +14,17 @@ describe StorageHelper do
expect(helper.storage_counter(2.megabytes)).to eq '2 MB'
end
- it 'uses commas as thousands separator' do
- expect(helper.storage_counter(100_000_000_000_000_000)).to eq '90,949.5 TB'
+ # Since rails 5 beta 2 support of petabytes and exabytes were added to the `number_to_human*` methods.
+ # See https://github.com/rails/rails/pull/22759
+ # The `number_to_human` method is used in the GitLab's `storage_counter` helper.
+ # Since 5.0 rails now returns thousands of terabytes as petabytes, so there's no any comma as the thousands separator.
+ # So we don't want to check that anymore. And we don't want to test that rails returns petabytes either
+ # as rails team already does it in rails code itself.
+ # Remove this test when removing rails5 code.
+ unless Gitlab.rails5?
+ it 'uses commas as thousands separator' do
+ expect(helper.storage_counter(100_000_000_000_000_000)).to eq '90,949.5 TB'
+ end
end
end
end