Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
f0eaf225
Commit
f0eaf225
authored
Jun 27, 2018
by
Jasper Maes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rails5 fix MySQL milliseconds problem in specs
parent
07de43a7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
13 deletions
+18
-13
changelogs/unreleased/rails5-fix-48430.yml
changelogs/unreleased/rails5-fix-48430.yml
+5
-0
spec/lib/gitlab/data_builder/note_spec.rb
spec/lib/gitlab/data_builder/note_spec.rb
+4
-4
spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb
...lab/github_import/importer/pull_requests_importer_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+2
-2
spec/services/keys/last_used_service_spec.rb
spec/services/keys/last_used_service_spec.rb
+2
-2
spec/services/update_merge_request_metrics_service_spec.rb
spec/services/update_merge_request_metrics_service_spec.rb
+2
-2
spec/support/shared_examples/throttled_touch.rb
spec/support/shared_examples/throttled_touch.rb
+2
-2
No files found.
changelogs/unreleased/rails5-fix-48430.yml
0 → 100644
View file @
f0eaf225
---
title
:
Rails5 fix MySQL milliseconds problem in specs
merge_request
:
20221
author
:
Jasper Maes
type
:
fixed
spec/lib/gitlab/data_builder/note_spec.rb
View file @
f0eaf225
...
...
@@ -52,7 +52,7 @@ describe Gitlab::DataBuilder::Note do
expect
(
data
[
:issue
].
except
(
'updated_at'
))
.
to
eq
(
issue
.
reload
.
hook_attrs
.
except
(
'updated_at'
))
expect
(
data
[
:issue
][
'updated_at'
])
.
to
be
>
issue
.
hook_attrs
[
'updated_at'
]
.
to
be
>
=
issue
.
hook_attrs
[
'updated_at'
]
end
context
'with confidential issue'
do
...
...
@@ -84,7 +84,7 @@ describe Gitlab::DataBuilder::Note do
expect
(
data
[
:merge_request
].
except
(
'updated_at'
))
.
to
eq
(
merge_request
.
reload
.
hook_attrs
.
except
(
'updated_at'
))
expect
(
data
[
:merge_request
][
'updated_at'
])
.
to
be
>
merge_request
.
hook_attrs
[
'updated_at'
]
.
to
be
>
=
merge_request
.
hook_attrs
[
'updated_at'
]
end
include_examples
'project hook data'
...
...
@@ -107,7 +107,7 @@ describe Gitlab::DataBuilder::Note do
expect
(
data
[
:merge_request
].
except
(
'updated_at'
))
.
to
eq
(
merge_request
.
reload
.
hook_attrs
.
except
(
'updated_at'
))
expect
(
data
[
:merge_request
][
'updated_at'
])
.
to
be
>
merge_request
.
hook_attrs
[
'updated_at'
]
.
to
be
>
=
merge_request
.
hook_attrs
[
'updated_at'
]
end
include_examples
'project hook data'
...
...
@@ -130,7 +130,7 @@ describe Gitlab::DataBuilder::Note do
expect
(
data
[
:snippet
].
except
(
'updated_at'
))
.
to
eq
(
snippet
.
reload
.
hook_attrs
.
except
(
'updated_at'
))
expect
(
data
[
:snippet
][
'updated_at'
])
.
to
be
>
snippet
.
hook_attrs
[
'updated_at'
]
.
to
be
>
=
snippet
.
hook_attrs
[
'updated_at'
]
end
include_examples
'project hook data'
...
...
spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb
View file @
f0eaf225
...
...
@@ -164,7 +164,7 @@ describe Gitlab::GithubImport::Importer::PullRequestsImporter do
Timecop
.
freeze
do
importer
.
update_repository
expect
(
project
.
last_repository_updated_at
).
to
eq
(
Time
.
zone
.
now
)
expect
(
project
.
last_repository_updated_at
).
to
be_like_time
(
Time
.
zone
.
now
)
end
end
end
...
...
spec/models/project_spec.rb
View file @
f0eaf225
...
...
@@ -571,13 +571,13 @@ describe Project do
last_activity_at:
timestamp
,
last_repository_updated_at:
timestamp
-
1
.
hour
)
expect
(
project
.
last_activity_date
).
to
eq
(
timestamp
)
expect
(
project
.
last_activity_date
).
to
be_like_time
(
timestamp
)
project
.
update_attributes
(
updated_at:
timestamp
,
last_activity_at:
timestamp
-
1
.
hour
,
last_repository_updated_at:
nil
)
expect
(
project
.
last_activity_date
).
to
eq
(
timestamp
)
expect
(
project
.
last_activity_date
).
to
be_like_time
(
timestamp
)
end
end
end
...
...
spec/services/keys/last_used_service_spec.rb
View file @
f0eaf225
...
...
@@ -8,7 +8,7 @@ describe Keys::LastUsedService do
Timecop
.
freeze
(
time
)
{
described_class
.
new
(
key
).
execute
}
expect
(
key
.
last_used_at
).
to
eq
(
time
)
expect
(
key
.
reload
.
last_used_at
).
to
be_like_time
(
time
)
end
it
'does not update the key when it has been used recently'
do
...
...
@@ -17,7 +17,7 @@ describe Keys::LastUsedService do
described_class
.
new
(
key
).
execute
expect
(
key
.
last_used_at
).
to
eq
(
time
)
expect
(
key
.
last_used_at
).
to
be_like_time
(
time
)
end
it
'does not update the updated_at field'
do
...
...
spec/services/update_merge_request_metrics_service_spec.rb
View file @
f0eaf225
...
...
@@ -12,7 +12,7 @@ describe MergeRequestMetricsService do
service
.
merge
(
event
)
expect
(
metrics
.
merged_by
).
to
eq
(
user
)
expect
(
metrics
.
merged_at
).
to
eq
(
event
.
created_at
)
expect
(
metrics
.
merged_at
).
to
be_like_time
(
event
.
created_at
)
end
end
...
...
@@ -25,7 +25,7 @@ describe MergeRequestMetricsService do
service
.
close
(
event
)
expect
(
metrics
.
latest_closed_by
).
to
eq
(
user
)
expect
(
metrics
.
latest_closed_at
).
to
eq
(
event
.
created_at
)
expect
(
metrics
.
latest_closed_at
).
to
be_like_time
(
event
.
created_at
)
end
end
...
...
spec/support/shared_examples/throttled_touch.rb
View file @
f0eaf225
...
...
@@ -3,7 +3,7 @@ shared_examples_for 'throttled touch' do
it
'updates the updated_at timestamp'
do
Timecop
.
freeze
do
subject
.
touch
expect
(
subject
.
updated_at
).
to
eq
(
Time
.
zone
.
now
)
expect
(
subject
.
updated_at
).
to
be_like_time
(
Time
.
zone
.
now
)
end
end
...
...
@@ -14,7 +14,7 @@ shared_examples_for 'throttled touch' do
Timecop
.
freeze
(
first_updated_at
)
{
subject
.
touch
}
Timecop
.
freeze
(
second_updated_at
)
{
subject
.
touch
}
expect
(
subject
.
updated_at
).
to
eq
(
first_updated_at
)
expect
(
subject
.
updated_at
).
to
be_like_time
(
first_updated_at
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment