Merge branch '20055-build-duration-showing-too-many-digits' into 'master'
Cast duration to integer in `TimeHelper#time_interval_in_words` Fixes #20055. - [x] No CHANGELOG since it fixes a regression introduced in RC12. - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5391
This commit is contained in:
commit
57e97a735e
2 changed files with 2 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
module TimeHelper
|
||||
def time_interval_in_words(interval_in_seconds)
|
||||
interval_in_seconds = interval_in_seconds.to_i
|
||||
minutes = interval_in_seconds / 60
|
||||
seconds = interval_in_seconds - minutes * 60
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ describe TimeHelper do
|
|||
it "returns minutes and seconds" do
|
||||
intervals_in_words = {
|
||||
100 => "1 minute 40 seconds",
|
||||
100.32 => "1 minute 40 seconds",
|
||||
121 => "2 minutes 1 second",
|
||||
3721 => "62 minutes 1 second",
|
||||
0 => "0 seconds"
|
||||
|
|
Loading…
Reference in a new issue