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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
32e086bf
Commit
32e086bf
authored
Nov 19, 2020
by
Alishan Ladhani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some usages of Timecop.freeze
To comply with RSpec/TimecopFreeze cop
parent
c0c3f829
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
11 additions
and
19 deletions
+11
-19
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-8
spec/features/profiles/active_sessions_spec.rb
spec/features/profiles/active_sessions_spec.rb
+1
-1
spec/features/projects/environments/environment_metrics_spec.rb
...eatures/projects/environments/environment_metrics_spec.rb
+1
-1
spec/lib/atlassian/jira_connect/client_spec.rb
spec/lib/atlassian/jira_connect/client_spec.rb
+1
-1
spec/lib/gitlab/anonymous_session_spec.rb
spec/lib/gitlab/anonymous_session_spec.rb
+1
-1
spec/models/container_repository_spec.rb
spec/models/container_repository_spec.rb
+1
-1
spec/models/pages/lookup_path_spec.rb
spec/models/pages/lookup_path_spec.rb
+2
-2
spec/models/project_feature_usage_spec.rb
spec/models/project_feature_usage_spec.rb
+2
-2
spec/requests/api/v3/github_spec.rb
spec/requests/api/v3/github_spec.rb
+2
-2
No files found.
.rubocop_manual_todo.yml
View file @
32e086bf
...
...
@@ -695,14 +695,10 @@ RSpec/TimecopFreeze:
-
'
ee/spec/services/vulnerability_exports/export_service_spec.rb'
-
'
ee/spec/support/shared_contexts/lib/gitlab/insights/reducers/reducers_shared_contexts.rb'
-
'
qa/spec/support/repeater_spec.rb'
-
'
spec/features/profiles/active_sessions_spec.rb'
-
'
spec/features/projects/environments/environment_metrics_spec.rb'
-
'
spec/features/users/active_sessions_spec.rb'
-
'
spec/lib/atlassian/jira_connect/client_spec.rb'
-
'
spec/lib/gitlab/analytics/cycle_analytics/base_query_builder_spec.rb'
-
'
spec/lib/gitlab/analytics/cycle_analytics/median_spec.rb'
-
'
spec/lib/gitlab/analytics/cycle_analytics/records_fetcher_spec.rb'
-
'
spec/lib/gitlab/anonymous_session_spec.rb'
-
'
spec/lib/gitlab/auth/unique_ips_limiter_spec.rb'
-
'
spec/lib/gitlab/checks/timed_logger_spec.rb'
-
'
spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb'
...
...
@@ -715,10 +711,6 @@ RSpec/TimecopFreeze:
-
'
spec/lib/rspec_flaky/flaky_example_spec.rb'
-
'
spec/lib/rspec_flaky/listener_spec.rb'
-
'
spec/models/active_session_spec.rb'
-
'
spec/models/container_repository_spec.rb'
-
'
spec/models/pages/lookup_path_spec.rb'
-
'
spec/models/project_feature_usage_spec.rb'
-
'
spec/requests/api/v3/github_spec.rb'
-
'
spec/serializers/entity_date_helper_spec.rb'
-
'
spec/support/cycle_analytics_helpers/test_generation.rb'
-
'
spec/support/helpers/cycle_analytics_helpers.rb'
...
...
spec/features/profiles/active_sessions_spec.rb
View file @
32e086bf
...
...
@@ -12,7 +12,7 @@ RSpec.describe 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do
let
(
:admin
)
{
create
(
:admin
)
}
it
'User sees their active sessions'
do
Timecop
.
freeze
(
Time
.
zone
.
parse
(
'2018-03-12 09:06'
))
do
travel_to
(
Time
.
zone
.
parse
(
'2018-03-12 09:06'
))
do
Capybara
::
Session
.
new
(
:session1
)
Capybara
::
Session
.
new
(
:session2
)
Capybara
::
Session
.
new
(
:session3
)
...
...
spec/features/projects/environments/environment_metrics_spec.rb
View file @
32e086bf
...
...
@@ -22,7 +22,7 @@ RSpec.describe 'Environment > Metrics' do
end
around
do
|
example
|
Timecop
.
freeze
(
current_time
)
{
example
.
run
}
travel_to
(
current_time
)
{
example
.
run
}
end
shared_examples
'has environment selector'
do
...
...
spec/lib/atlassian/jira_connect/client_spec.rb
View file @
32e086bf
...
...
@@ -8,7 +8,7 @@ RSpec.describe Atlassian::JiraConnect::Client do
subject
{
described_class
.
new
(
'https://gitlab-test.atlassian.net'
,
'sample_secret'
)
}
around
do
|
example
|
Timecop
.
freez
e
{
example
.
run
}
freeze_tim
e
{
example
.
run
}
end
describe
'.generate_update_sequence_id'
do
...
...
spec/lib/gitlab/anonymous_session_spec.rb
View file @
32e086bf
...
...
@@ -22,7 +22,7 @@ RSpec.describe Gitlab::AnonymousSession, :clean_gitlab_redis_shared_state do
end
it
'adds expiration time to key'
do
Timecop
.
freez
e
do
freeze_tim
e
do
subject
.
count_session_ip
Gitlab
::
Redis
::
SharedState
.
with
do
|
redis
|
...
...
spec/models/container_repository_spec.rb
View file @
32e086bf
...
...
@@ -188,7 +188,7 @@ RSpec.describe ContainerRepository do
subject
{
repository
.
start_expiration_policy!
}
it
'sets the expiration policy started at to now'
do
Timecop
.
freez
e
do
freeze_tim
e
do
expect
{
subject
}
.
to
change
{
repository
.
expiration_policy_started_at
}.
from
(
nil
).
to
(
Time
.
zone
.
now
)
end
...
...
spec/models/pages/lookup_path_spec.rb
View file @
32e086bf
...
...
@@ -65,7 +65,7 @@ RSpec.describe Pages::LookupPath do
end
it
'uses deployment from object storage'
do
Timecop
.
freez
e
do
freeze_tim
e
do
expect
(
source
).
to
(
eq
({
type:
'zip'
,
...
...
@@ -85,7 +85,7 @@ RSpec.describe Pages::LookupPath do
end
it
'uses file protocol'
do
Timecop
.
freez
e
do
freeze_tim
e
do
expect
(
source
).
to
(
eq
({
type:
'zip'
,
...
...
spec/models/project_feature_usage_spec.rb
View file @
32e086bf
...
...
@@ -25,7 +25,7 @@ RSpec.describe ProjectFeatureUsage, type: :model do
subject
{
project
.
feature_usage
}
it
'logs Jira DVCS Cloud last sync'
do
Timecop
.
freez
e
do
freeze_tim
e
do
subject
.
log_jira_dvcs_integration_usage
expect
(
subject
.
jira_dvcs_server_last_sync_at
).
to
be_nil
...
...
@@ -34,7 +34,7 @@ RSpec.describe ProjectFeatureUsage, type: :model do
end
it
'logs Jira DVCS Server last sync'
do
Timecop
.
freez
e
do
freeze_tim
e
do
subject
.
log_jira_dvcs_integration_usage
(
cloud:
false
)
expect
(
subject
.
jira_dvcs_server_last_sync_at
).
to
be_like_time
(
Time
.
current
)
...
...
spec/requests/api/v3/github_spec.rb
View file @
32e086bf
...
...
@@ -383,7 +383,7 @@ RSpec.describe API::V3::Github do
it
'counts Jira Cloud integration as enabled'
do
user_agent
=
'Jira DVCS Connector Vertigo/4.42.0'
Timecop
.
freez
e
do
freeze_tim
e
do
jira_get
v3_api
(
"/repos/
#{
project
.
namespace
.
path
}
/
#{
project
.
path
}
/branches"
,
user
),
user_agent
expect
(
project
.
reload
.
jira_dvcs_cloud_last_sync_at
).
to
be_like_time
(
Time
.
now
)
...
...
@@ -393,7 +393,7 @@ RSpec.describe API::V3::Github do
it
'counts Jira Server integration as enabled'
do
user_agent
=
'Jira DVCS Connector/3.2.4'
Timecop
.
freez
e
do
freeze_tim
e
do
jira_get
v3_api
(
"/repos/
#{
project
.
namespace
.
path
}
/
#{
project
.
path
}
/branches"
,
user
),
user_agent
expect
(
project
.
reload
.
jira_dvcs_server_last_sync_at
).
to
be_like_time
(
Time
.
now
)
...
...
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