summaryrefslogtreecommitdiff
path: root/spec/helpers/storage_helper_spec.rb
diff options
context:
space:
mode:
authorAndreas Kämmerle <andreas.kaemmerle@gmail.com>2018-07-03 15:30:36 +0200
committerAndreas Kämmerle <andreas.kaemmerle@gmail.com>2018-07-03 15:30:36 +0200
commite4a310113a3a5784be863151e5bcecacb23aa244 (patch)
tree79f9019b2e001a192eae3569b5746ba9c4ec9476 /spec/helpers/storage_helper_spec.rb
parentd505b48806c0880ac810374973c4b9ba802c26e8 (diff)
parentc489d53b2e2eecb22f8dc7034da142221220e89f (diff)
downloadgitlab-ce-e4a310113a3a5784be863151e5bcecacb23aa244.tar.gz
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into update-template-name-via-sentence-case
# Conflicts: # .gitlab/issue_templates/Feature proposal.md
Diffstat (limited to 'spec/helpers/storage_helper_spec.rb')
-rw-r--r--spec/helpers/storage_helper_spec.rb24
1 files changed, 14 insertions, 10 deletions
diff --git a/spec/helpers/storage_helper_spec.rb b/spec/helpers/storage_helper_spec.rb
index 4627a1e1872..c580b78c908 100644
--- a/spec/helpers/storage_helper_spec.rb
+++ b/spec/helpers/storage_helper_spec.rb
@@ -1,21 +1,25 @@
-require 'spec_helper'
+require "spec_helper"
describe StorageHelper do
- describe '#storage_counter' do
- it 'formats bytes to one decimal place' do
- expect(helper.storage_counter(1.23.megabytes)).to eq '1.2 MB'
+ describe "#storage_counter" do
+ it "formats bytes to one decimal place" do
+ expect(helper.storage_counter(1.23.megabytes)).to eq("1.2 MB")
end
- it 'does not add decimals for sizes < 1 MB' do
- expect(helper.storage_counter(23.5.kilobytes)).to eq '24 KB'
+ it "does not add decimals for sizes < 1 MB" do
+ expect(helper.storage_counter(23.5.kilobytes)).to eq("24 KB")
end
- it 'does not add decimals for zeroes' do
- expect(helper.storage_counter(2.megabytes)).to eq '2 MB'
+ it "does not add decimals for zeroes" 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'
+ it "uses commas as thousands separator" do
+ if Gitlab.rails5?
+ expect(helper.storage_counter(100_000_000_000_000_000_000_000)).to eq("86,736.2 EB")
+ else
+ expect(helper.storage_counter(100_000_000_000_000_000)).to eq("90,949.5 TB")
+ end
end
end
end