summaryrefslogtreecommitdiff
path: root/spec/helpers/time_helper_spec.rb
diff options
context:
space:
mode:
authorConstance Okoghenun <constanceokoghenun@gmail.com>2018-10-23 09:06:21 +0100
committerConstance Okoghenun <constanceokoghenun@gmail.com>2018-10-23 09:06:21 +0100
commit70bf1831511628085e58bfec0cf2c8fc14e6936c (patch)
tree16d7130d8b4ce09bff582e4506ca191253a2895c /spec/helpers/time_helper_spec.rb
parent242d7ae2ee47bb078c8fd2ec9dae37268fc0a2b2 (diff)
parent10bb8297ebe5fc01540b20c3fd365234779b6837 (diff)
downloadgitlab-ce-70bf1831511628085e58bfec0cf2c8fc14e6936c.tar.gz
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into 26723-discussion-filters26723-discussion-filters
Diffstat (limited to 'spec/helpers/time_helper_spec.rb')
-rw-r--r--spec/helpers/time_helper_spec.rb35
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