diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-04-12 06:05:07 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-04-12 06:05:07 +0300 |
commit | d28b1dfc46d9f95c516c19aa9a2d166be554eca2 (patch) | |
tree | 9d3b50cc026d4bf8f8c4b8acc63f075269ce9ab7 /spec/lib/gitlab/utils_spec.rb | |
parent | dd552d06f6e39d5e6138a33bd7c1bffb2d3dbb1d (diff) |
Backport of EE !4989
Diffstat (limited to 'spec/lib/gitlab/utils_spec.rb')
-rw-r--r-- | spec/lib/gitlab/utils_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/lib/gitlab/utils_spec.rb b/spec/lib/gitlab/utils_spec.rb index 71a743495a2..4ba99009855 100644 --- a/spec/lib/gitlab/utils_spec.rb +++ b/spec/lib/gitlab/utils_spec.rb @@ -1,7 +1,8 @@ require 'spec_helper' describe Gitlab::Utils do - delegate :to_boolean, :boolean_to_yes_no, :slugify, :random_string, :which, :ensure_array_from_string, to: :described_class + delegate :to_boolean, :boolean_to_yes_no, :slugify, :random_string, :which, :ensure_array_from_string, + :bytes_to_megabytes, to: :described_class describe '.slugify' do { @@ -97,4 +98,12 @@ describe Gitlab::Utils do expect(ensure_array_from_string(str)).to eq(%w[seven eight 9 10]) end end + + describe '.bytes_to_megabytes' do + it 'converts bytes to megabytes' do + bytes = 1.megabyte + + expect(bytes_to_megabytes(bytes)).to eq(1) + end + end end |