summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/time_helper_spec.rb35
-rw-r--r--spec/lib/gitlab/ci/status/build/scheduled_spec.rb4
2 files changed, 11 insertions, 28 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
diff --git a/spec/lib/gitlab/ci/status/build/scheduled_spec.rb b/spec/lib/gitlab/ci/status/build/scheduled_spec.rb
index f98183d6d18..4a52b3ab8de 100644
--- a/spec/lib/gitlab/ci/status/build/scheduled_spec.rb
+++ b/spec/lib/gitlab/ci/status/build/scheduled_spec.rb
@@ -26,9 +26,9 @@ describe Gitlab::Ci::Status::Build::Scheduled do
context 'when scheduled_at is expired' do
let(:build) { create(:ci_build, :expired_scheduled, project: project) }
- it 'shows 00:00:00' do
+ it 'shows 00:00' do
Timecop.freeze do
- expect(subject.status_tooltip).to include('00:00:00')
+ expect(subject.status_tooltip).to include('00:00')
end
end
end