diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-10-10 08:27:16 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-10-18 09:11:12 +0300 |
commit | 23526470ddb2a51575dd7c280b89d21bef6df619 (patch) | |
tree | 19f91de70b552273786a02143774abf8f9f408fb /spec | |
parent | e409834f1b1f182f8b387bab4c4ca9f7b350f68a (diff) |
Drop `allow_overflow` option in `TimeHelper.duration_in_numbers`
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/time_helper_spec.rb | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/spec/helpers/time_helper_spec.rb b/spec/helpers/time_helper_spec.rb index cc310766433..8bf378549fe 100644 --- a/spec/helpers/time_helper_spec.rb +++ b/spec/helpers/time_helper_spec.rb @@ -22,34 +22,17 @@ describe TimeHelper do describe "#duration_in_numbers" do using RSpec::Parameterized::TableSyntax - context "without passing allow_overflow" do - where(:duration, :formatted_string) do - 0 | "00:00" - 1.second | "00:01" - 42.seconds | "00:42" - 2.minutes + 1.second | "02:01" - 3.hours + 2.minutes + 1.second | "03:02:01" - 30.hours | "06:00:00" - end - - with_them do - it { expect(duration_in_numbers(duration)).to eq formatted_string } - end + where(:duration, :formatted_string) do + 0 | "00:00" + 1.second | "00:01" + 42.seconds | "00:42" + 2.minutes + 1.second | "02:01" + 3.hours + 2.minutes + 1.second | "03:02:01" + 30.hours | "30:00:00" end - context "with allow_overflow = true" do - where(:duration, :formatted_string) do - 0 | "00:00:00" - 1.second | "00:00:01" - 42.seconds | "00:00:42" - 2.minutes + 1.second | "00:02:01" - 3.hours + 2.minutes + 1.second | "03:02:01" - 30.hours | "30:00:00" - end - - with_them do - it { expect(duration_in_numbers(duration, true)).to eq formatted_string } - end + with_them do + it { expect(duration_in_numbers(duration)).to eq formatted_string } end end end |