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
993e93f9
Commit
993e93f9
authored
Oct 04, 2021
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the use of 'clean_frontend_fixtures'
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
10329c86
Changes
52
Hide whitespace changes
Inline
Side-by-side
Showing
52 changed files
with
11 additions
and
223 deletions
+11
-223
doc/development/testing_guide/frontend_testing.md
doc/development/testing_guide/frontend_testing.md
+0
-4
ee/spec/frontend/fixtures/analytics/charts.rb
ee/spec/frontend/fixtures/analytics/charts.rb
+0
-4
ee/spec/frontend/fixtures/analytics/devops_report/devops_adoption/enabled_namespaces.rb
...ytics/devops_report/devops_adoption/enabled_namespaces.rb
+0
-1
ee/spec/frontend/fixtures/analytics/metrics.rb
ee/spec/frontend/fixtures/analytics/metrics.rb
+0
-4
ee/spec/frontend/fixtures/api_markdown.rb
ee/spec/frontend/fixtures/api_markdown.rb
+1
-5
ee/spec/frontend/fixtures/dora/metrics.rb
ee/spec/frontend/fixtures/dora/metrics.rb
+0
-4
ee/spec/frontend/fixtures/epic.rb
ee/spec/frontend/fixtures/epic.rb
+0
-4
ee/spec/frontend/fixtures/merge_requests.rb
ee/spec/frontend/fixtures/merge_requests.rb
+0
-4
ee/spec/frontend/fixtures/saml_providers.rb
ee/spec/frontend/fixtures/saml_providers.rb
+0
-4
ee/spec/frontend/fixtures/search.rb
ee/spec/frontend/fixtures/search.rb
+0
-4
lib/tasks/frontend.rake
lib/tasks/frontend.rake
+7
-1
spec/frontend/fixtures/abuse_reports.rb
spec/frontend/fixtures/abuse_reports.rb
+0
-4
spec/frontend/fixtures/admin_users.rb
spec/frontend/fixtures/admin_users.rb
+0
-4
spec/frontend/fixtures/analytics.rb
spec/frontend/fixtures/analytics.rb
+0
-4
spec/frontend/fixtures/api_markdown.rb
spec/frontend/fixtures/api_markdown.rb
+1
-5
spec/frontend/fixtures/api_merge_requests.rb
spec/frontend/fixtures/api_merge_requests.rb
+0
-4
spec/frontend/fixtures/api_projects.rb
spec/frontend/fixtures/api_projects.rb
+0
-4
spec/frontend/fixtures/application_settings.rb
spec/frontend/fixtures/application_settings.rb
+0
-4
spec/frontend/fixtures/autocomplete.rb
spec/frontend/fixtures/autocomplete.rb
+0
-4
spec/frontend/fixtures/autocomplete_sources.rb
spec/frontend/fixtures/autocomplete_sources.rb
+0
-4
spec/frontend/fixtures/blob.rb
spec/frontend/fixtures/blob.rb
+0
-4
spec/frontend/fixtures/branches.rb
spec/frontend/fixtures/branches.rb
+0
-5
spec/frontend/fixtures/clusters.rb
spec/frontend/fixtures/clusters.rb
+0
-4
spec/frontend/fixtures/commit.rb
spec/frontend/fixtures/commit.rb
+0
-5
spec/frontend/fixtures/deploy_keys.rb
spec/frontend/fixtures/deploy_keys.rb
+0
-4
spec/frontend/fixtures/freeze_period.rb
spec/frontend/fixtures/freeze_period.rb
+0
-4
spec/frontend/fixtures/groups.rb
spec/frontend/fixtures/groups.rb
+0
-4
spec/frontend/fixtures/issues.rb
spec/frontend/fixtures/issues.rb
+0
-4
spec/frontend/fixtures/jobs.rb
spec/frontend/fixtures/jobs.rb
+0
-4
spec/frontend/fixtures/labels.rb
spec/frontend/fixtures/labels.rb
+0
-4
spec/frontend/fixtures/merge_requests.rb
spec/frontend/fixtures/merge_requests.rb
+0
-4
spec/frontend/fixtures/merge_requests_diffs.rb
spec/frontend/fixtures/merge_requests_diffs.rb
+0
-4
spec/frontend/fixtures/metrics_dashboard.rb
spec/frontend/fixtures/metrics_dashboard.rb
+0
-4
spec/frontend/fixtures/pipeline_schedules.rb
spec/frontend/fixtures/pipeline_schedules.rb
+0
-4
spec/frontend/fixtures/pipelines.rb
spec/frontend/fixtures/pipelines.rb
+0
-4
spec/frontend/fixtures/projects.rb
spec/frontend/fixtures/projects.rb
+0
-8
spec/frontend/fixtures/projects_json.rb
spec/frontend/fixtures/projects_json.rb
+0
-4
spec/frontend/fixtures/prometheus_service.rb
spec/frontend/fixtures/prometheus_service.rb
+0
-4
spec/frontend/fixtures/raw.rb
spec/frontend/fixtures/raw.rb
+0
-8
spec/frontend/fixtures/releases.rb
spec/frontend/fixtures/releases.rb
+0
-8
spec/frontend/fixtures/runner.rb
spec/frontend/fixtures/runner.rb
+0
-4
spec/frontend/fixtures/search.rb
spec/frontend/fixtures/search.rb
+0
-4
spec/frontend/fixtures/services.rb
spec/frontend/fixtures/services.rb
+0
-4
spec/frontend/fixtures/sessions.rb
spec/frontend/fixtures/sessions.rb
+0
-4
spec/frontend/fixtures/snippet.rb
spec/frontend/fixtures/snippet.rb
+0
-4
spec/frontend/fixtures/startup_css.rb
spec/frontend/fixtures/startup_css.rb
+0
-4
spec/frontend/fixtures/tags.rb
spec/frontend/fixtures/tags.rb
+0
-4
spec/frontend/fixtures/timezones.rb
spec/frontend/fixtures/timezones.rb
+0
-4
spec/frontend/fixtures/todos.rb
spec/frontend/fixtures/todos.rb
+0
-4
spec/frontend/fixtures/u2f.rb
spec/frontend/fixtures/u2f.rb
+0
-4
spec/frontend/fixtures/webauthn.rb
spec/frontend/fixtures/webauthn.rb
+0
-4
spec/support/helpers/javascript_fixtures_helpers.rb
spec/support/helpers/javascript_fixtures_helpers.rb
+2
-9
No files found.
doc/development/testing_guide/frontend_testing.md
View file @
993e93f9
...
...
@@ -848,10 +848,6 @@ describe GraphQL::Query, type: :request do
all_releases_query_path
=
'releases/graphql/queries/all_releases.query.graphql'
before
(
:all
)
do
clean_frontend_fixtures
(
'graphql/releases/'
)
end
it
"graphql/
#{
all_releases_query_path
}
.json"
do
query
=
get_graphql_query_as_string
(
all_releases_query_path
)
...
...
ee/spec/frontend/fixtures/analytics/charts.rb
View file @
993e93f9
...
...
@@ -12,10 +12,6 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
freeze_time
{
example
.
run
}
end
before
(
:all
)
do
clean_frontend_fixtures
(
'analytics/charts/'
)
end
describe
Groups
::
Analytics
::
TasksByTypeController
,
type: :controller
do
render_views
...
...
ee/spec/frontend/fixtures/analytics/devops_report/devops_adoption/enabled_namespaces.rb
View file @
993e93f9
...
...
@@ -37,7 +37,6 @@ RSpec.describe 'DevOps Adoption (GraphQL fixtures)' do
end
before
do
clean_frontend_fixtures
(
'graphql/analytics/devops_report/devops_adoption/'
)
stub_licensed_features
(
instance_level_devops_adoption:
true
,
group_level_devops_adoption:
true
)
end
...
...
ee/spec/frontend/fixtures/analytics/metrics.rb
View file @
993e93f9
...
...
@@ -29,10 +29,6 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
freeze_time
{
example
.
run
}
end
before
(
:all
)
do
clean_frontend_fixtures
(
'analytics/metrics'
)
end
describe
Groups
::
Analytics
::
CycleAnalytics
::
SummaryController
,
type: :controller
do
render_views
...
...
ee/spec/frontend/fixtures/api_markdown.rb
View file @
993e93f9
...
...
@@ -16,11 +16,7 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
let
(
:group_wiki_page
)
{
create
(
:wiki_page
,
wiki:
group_wiki
)
}
let
(
:project_wiki_page
)
{
create
(
:wiki_page
,
wiki:
project_wiki
)
}
fixture_subdir
=
'api/markdown'
before
(
:all
)
do
clean_frontend_fixtures
(
fixture_subdir
)
group
.
add_owner
(
user
)
end
...
...
@@ -44,7 +40,7 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
name
=
"
#{
context
}
_
#{
name
}
"
unless
context
.
empty?
it
"
#{
fixture_subdir
}
/
#{
name
}
.json"
do
it
"
api/markdown
/
#{
name
}
.json"
do
api_url
=
case
context
when
'group_wiki'
"/groups/
#{
group
.
full_path
}
/-/wikis/
#{
group_wiki_page
.
slug
}
/preview_markdown"
...
...
ee/spec/frontend/fixtures/dora/metrics.rb
View file @
993e93f9
...
...
@@ -44,10 +44,6 @@ RSpec.describe 'DORA Metrics (JavaScript fixtures)' do
}
end
before
(
:all
)
do
clean_frontend_fixtures
(
'api/dora/metrics'
)
end
def
make_request
(
additional_query_params
:)
params
=
shared_params
.
merge
(
additional_query_params
)
get
api
(
"/projects/
#{
project
.
id
}
/dora/metrics?
#{
params
.
to_query
}
"
,
reporter
)
...
...
ee/spec/frontend/fixtures/epic.rb
View file @
993e93f9
...
...
@@ -34,10 +34,6 @@ RSpec.describe 'Epics (JavaScript fixtures)' do
]
end
before
(
:all
)
do
clean_frontend_fixtures
(
'epic/'
)
end
describe
EpicPresenter
,
'(JavaScript fixtures)'
,
type: :presenter
do
let
(
:response
)
{
@json_data
.
to_json
}
...
...
ee/spec/frontend/fixtures/merge_requests.rb
View file @
993e93f9
...
...
@@ -11,10 +11,6 @@ RSpec.describe Projects::MergeRequestsController, '(JavaScript fixtures in EE co
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'ee/merge_requests/'
)
end
before
do
sign_in
(
user
)
end
...
...
ee/spec/frontend/fixtures/saml_providers.rb
View file @
993e93f9
...
...
@@ -9,10 +9,6 @@ RSpec.describe Groups::SamlProvidersController, '(JavaScript fixtures)', type: :
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'groups/saml_providers/'
)
end
before
do
sign_in
(
user
)
group
.
add_owner
(
user
)
...
...
ee/spec/frontend/fixtures/search.rb
View file @
993e93f9
...
...
@@ -9,10 +9,6 @@ RSpec.describe SearchController, '(JavaScript fixtures)', type: :controller do
let_it_be
(
:user
)
{
create
(
:admin
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'ee/search/'
)
end
before
do
sign_in
(
user
)
end
...
...
lib/tasks/frontend.rake
View file @
993e93f9
# frozen_string_literal: true
require
'yaml'
unless
Rails
.
env
.
production?
namespace
:frontend
do
desc
'GitLab | Frontend | Generate fixtures for JavaScript tests'
RSpec
::
Core
::
RakeTask
.
new
(
:fixtures
,
[
:pattern
])
do
|
t
,
args
|
require
'fileutils'
require_relative
'../../spec/support/helpers/javascript_fixtures_helpers'
FileUtils
.
rm_r
(
JavaScriptFixturesHelpers
.
fixture_root_path
,
force:
true
)
directories
=
%w[spec]
directories
<<
'ee/spec'
if
Gitlab
.
ee?
directory_glob
=
"{
#{
directories
.
join
(
','
)
}
}"
...
...
@@ -16,6 +20,8 @@ unless Rails.env.production?
desc
'GitLab | Frontend | Generate fixtures for JavaScript integration tests'
RSpec
::
Core
::
RakeTask
.
new
(
:mock_server_rspec_fixtures
)
do
|
t
,
args
|
require
'yaml'
base_path
=
Pathname
.
new
(
'spec/frontend_integration/fixture_generators.yml'
)
ee_path
=
Pathname
.
new
(
'ee'
)
+
base_path
...
...
spec/frontend/fixtures/abuse_reports.rb
View file @
993e93f9
...
...
@@ -13,10 +13,6 @@ RSpec.describe Admin::AbuseReportsController, '(JavaScript fixtures)', type: :co
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'abuse_reports/'
)
end
before
do
sign_in
(
admin
)
enable_admin_mode!
(
admin
)
...
...
spec/frontend/fixtures/admin_users.rb
View file @
993e93f9
...
...
@@ -17,10 +17,6 @@ RSpec.describe Admin::UsersController, '(JavaScript fixtures)', type: :controlle
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'admin/users'
)
end
it
'admin/users/new_with_internal_user_regex.html'
do
stub_application_setting
(
user_default_external:
true
)
stub_application_setting
(
user_default_internal_regex:
'^(?:(?!\.ext@).)*$\r?'
)
...
...
spec/frontend/fixtures/analytics.rb
View file @
993e93f9
...
...
@@ -6,10 +6,6 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
let_it_be
(
:value_stream_id
)
{
'default'
}
before
(
:all
)
do
clean_frontend_fixtures
(
'projects/analytics/value_stream_analytics/'
)
end
before
do
update_metrics
create_deployment
...
...
spec/frontend/fixtures/api_markdown.rb
View file @
993e93f9
...
...
@@ -21,11 +21,7 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
let
(
:project_wiki_page
)
{
create
(
:wiki_page
,
wiki:
project_wiki
)
}
fixture_subdir
=
'api/markdown'
before
(
:all
)
do
clean_frontend_fixtures
(
fixture_subdir
)
group
.
add_owner
(
user
)
project
.
add_maintainer
(
user
)
end
...
...
@@ -49,7 +45,7 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
name
=
"
#{
context
}
_
#{
name
}
"
unless
context
.
empty?
it
"
#{
fixture_subdir
}
/
#{
name
}
.json"
do
it
"
api/markdown
/
#{
name
}
.json"
do
api_url
=
case
context
when
'project'
"/
#{
project
.
full_path
}
/preview_markdown"
...
...
spec/frontend/fixtures/api_merge_requests.rb
View file @
993e93f9
...
...
@@ -11,10 +11,6 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'lorem-ipsum'
)
}
let_it_be
(
:mr
)
{
create
(
:merge_request
,
source_project:
project
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'api/merge_requests'
)
end
it
'api/merge_requests/get.json'
do
4
.
times
{
|
i
|
create
(
:merge_request
,
source_project:
project
,
source_branch:
"branch-
#{
i
}
"
)
}
...
...
spec/frontend/fixtures/api_projects.rb
View file @
993e93f9
...
...
@@ -11,10 +11,6 @@ RSpec.describe API::Projects, '(JavaScript fixtures)', type: :request do
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'lorem-ipsum'
)
}
let
(
:project_empty
)
{
create
(
:project_empty_repo
,
namespace:
namespace
,
path:
'lorem-ipsum-empty'
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'api/projects'
)
end
it
'api/projects/get.json'
do
get
api
(
"/projects/
#{
project
.
id
}
"
,
admin
)
...
...
spec/frontend/fixtures/application_settings.rb
View file @
993e93f9
...
...
@@ -19,10 +19,6 @@ RSpec.describe Admin::ApplicationSettingsController, '(JavaScript fixtures)', ty
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'application_settings/'
)
end
after
do
remove_repository
(
project
)
end
...
...
spec/frontend/fixtures/autocomplete.rb
View file @
993e93f9
...
...
@@ -11,10 +11,6 @@ RSpec.describe ::AutocompleteController, '(JavaScript fixtures)', type: :control
let
(
:project
)
{
create
(
:project
,
namespace:
group
,
path:
'autocomplete-project'
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
author:
user
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'autocomplete/'
)
end
before
do
group
.
add_owner
(
user
)
sign_in
(
user
)
...
...
spec/frontend/fixtures/autocomplete_sources.rb
View file @
993e93f9
...
...
@@ -10,10 +10,6 @@ RSpec.describe Projects::AutocompleteSourcesController, '(JavaScript fixtures)',
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
,
path:
'autocomplete-sources-project'
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'autocomplete_sources/'
)
end
before
do
group
.
add_owner
(
user
)
sign_in
(
user
)
...
...
spec/frontend/fixtures/blob.rb
View file @
993e93f9
...
...
@@ -11,10 +11,6 @@ RSpec.describe Projects::BlobController, '(JavaScript fixtures)', type: :control
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'blob/'
)
end
before
do
sign_in
(
user
)
allow
(
SecureRandom
).
to
receive
(
:hex
).
and_return
(
'securerandomhex:thereisnospoon'
)
...
...
spec/frontend/fixtures/branches.rb
View file @
993e93f9
...
...
@@ -9,11 +9,6 @@ RSpec.describe 'Branches (JavaScript fixtures)' do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'branches-project'
)
}
let_it_be
(
:user
)
{
project
.
owner
}
before
(
:all
)
do
clean_frontend_fixtures
(
'branches/'
)
clean_frontend_fixtures
(
'api/branches/'
)
end
after
(
:all
)
do
remove_repository
(
project
)
end
...
...
spec/frontend/fixtures/clusters.rb
View file @
993e93f9
...
...
@@ -12,10 +12,6 @@ RSpec.describe Projects::ClustersController, '(JavaScript fixtures)', type: :con
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'clusters/'
)
end
before
do
sign_in
(
user
)
end
...
...
spec/frontend/fixtures/commit.rb
View file @
993e93f9
...
...
@@ -9,11 +9,6 @@ RSpec.describe 'Commit (JavaScript fixtures)' do
let_it_be
(
:user
)
{
project
.
owner
}
let_it_be
(
:commit
)
{
project
.
commit
(
"master"
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'commit/'
)
clean_frontend_fixtures
(
'api/commits/'
)
end
before
do
allow
(
SecureRandom
).
to
receive
(
:hex
).
and_return
(
'securerandomhex:thereisnospoon'
)
end
...
...
spec/frontend/fixtures/deploy_keys.rb
View file @
993e93f9
...
...
@@ -13,10 +13,6 @@ RSpec.describe Projects::DeployKeysController, '(JavaScript fixtures)', type: :c
let
(
:project3
)
{
create
(
:project
,
:internal
)}
let
(
:project4
)
{
create
(
:project
,
:internal
)}
before
(
:all
)
do
clean_frontend_fixtures
(
'deploy_keys/'
)
end
before
do
# Using an admin for these fixtures because they are used for verifying a frontend
# component that would normally get its data from `Admin::DeployKeysController`
...
...
spec/frontend/fixtures/freeze_period.rb
View file @
993e93f9
...
...
@@ -9,10 +9,6 @@ RSpec.describe 'Freeze Periods (JavaScript fixtures)' do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
path:
'freeze-periods-project'
)
}
let_it_be
(
:user
)
{
project
.
owner
}
before
(
:all
)
do
clean_frontend_fixtures
(
'api/freeze-periods/'
)
end
after
(
:all
)
do
remove_repository
(
project
)
end
...
...
spec/frontend/fixtures/groups.rb
View file @
993e93f9
...
...
@@ -8,10 +8,6 @@ RSpec.describe 'Groups (JavaScript fixtures)', type: :controller do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
,
name:
'frontend-fixtures-group'
,
runners_token:
'runnerstoken:intabulasreferre'
)}
before
(
:all
)
do
clean_frontend_fixtures
(
'groups/'
)
end
before
do
group
.
add_owner
(
user
)
sign_in
(
user
)
...
...
spec/frontend/fixtures/issues.rb
View file @
993e93f9
...
...
@@ -11,10 +11,6 @@ RSpec.describe Projects::IssuesController, '(JavaScript fixtures)', type: :contr
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'issues/'
)
end
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
...
...
spec/frontend/fixtures/jobs.rb
View file @
993e93f9
...
...
@@ -21,10 +21,6 @@ RSpec.describe Projects::JobsController, '(JavaScript fixtures)', type: :control
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'jobs/'
)
end
before
do
sign_in
(
user
)
end
...
...
spec/frontend/fixtures/labels.rb
View file @
993e93f9
...
...
@@ -17,10 +17,6 @@ RSpec.describe 'Labels (JavaScript fixtures)' do
let!
(
:groub_label_space
)
{
create
(
:group_label
,
group:
group
,
title:
'some space'
,
color:
'#FFFFFF'
)
}
let!
(
:groub_label_violets
)
{
create
(
:group_label
,
group:
group
,
title:
'violets'
,
color:
'#0000FF'
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'labels/'
)
end
after
do
remove_repository
(
project
)
end
...
...
spec/frontend/fixtures/merge_requests.rb
View file @
993e93f9
...
...
@@ -49,10 +49,6 @@ RSpec.describe Projects::MergeRequestsController, '(JavaScript fixtures)', type:
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'merge_requests/'
)
end
before
do
sign_in
(
user
)
allow
(
Discussion
).
to
receive
(
:build_discussion_id
).
and_return
([
'discussionid:ceterumcenseo'
])
...
...
spec/frontend/fixtures/merge_requests_diffs.rb
View file @
993e93f9
...
...
@@ -20,10 +20,6 @@ RSpec.describe Projects::MergeRequests::DiffsController, '(JavaScript fixtures)'
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'merge_request_diffs/'
)
end
before
do
# Create a user that matches the project.commit author
# This is so that the "author" information will be populated
...
...
spec/frontend/fixtures/metrics_dashboard.rb
View file @
993e93f9
...
...
@@ -12,10 +12,6 @@ RSpec.describe MetricsDashboard, '(JavaScript fixtures)', type: :controller do
let_it_be
(
:environment
)
{
create
(
:environment
,
id:
1
,
project:
project
)
}
let_it_be
(
:params
)
{
{
environment:
environment
}
}
before
(
:all
)
do
clean_frontend_fixtures
(
'metrics_dashboard/'
)
end
controller
(
::
ApplicationController
)
do
include
MetricsDashboard
end
...
...
spec/frontend/fixtures/pipeline_schedules.rb
View file @
993e93f9
...
...
@@ -15,10 +15,6 @@ RSpec.describe Projects::PipelineSchedulesController, '(JavaScript fixtures)', t
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'pipeline_schedules/'
)
end
before
do
sign_in
(
user
)
end
...
...
spec/frontend/fixtures/pipelines.rb
View file @
993e93f9
...
...
@@ -23,10 +23,6 @@ RSpec.describe Projects::PipelinesController, '(JavaScript fixtures)', type: :co
let!
(
:build_test
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
'test'
)
}
let!
(
:build_deploy_failed
)
{
create
(
:ci_build
,
status: :failed
,
pipeline:
pipeline
,
stage:
'deploy'
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'pipelines/'
)
end
before
do
sign_in
(
user
)
end
...
...
spec/frontend/fixtures/projects.rb
View file @
993e93f9
...
...
@@ -16,10 +16,6 @@ RSpec.describe 'Projects (JavaScript fixtures)', type: :controller do
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'projects/'
)
end
before
do
project_with_repo
.
add_maintainer
(
user
)
sign_in
(
user
)
...
...
@@ -57,10 +53,6 @@ RSpec.describe 'Projects (JavaScript fixtures)', type: :controller do
project_variable_populated
.
add_maintainer
(
user
)
end
before
(
:all
)
do
clean_frontend_fixtures
(
'graphql/projects/access_tokens'
)
end
base_input_path
=
'access_tokens/graphql/queries/'
base_output_path
=
'graphql/projects/access_tokens/'
query_name
=
'get_projects.query.graphql'
...
...
spec/frontend/fixtures/projects_json.rb
View file @
993e93f9
...
...
@@ -8,10 +8,6 @@ RSpec.describe 'Projects JSON endpoints (JavaScript fixtures)', type: :controlle
let
(
:admin
)
{
create
(
:admin
,
name:
'root'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'projects_json/'
)
end
before
do
project
.
add_maintainer
(
admin
)
sign_in
(
admin
)
...
...
spec/frontend/fixtures/prometheus_service.rb
View file @
993e93f9
...
...
@@ -12,10 +12,6 @@ RSpec.describe Projects::ServicesController, '(JavaScript fixtures)', type: :con
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'services/prometheus'
)
end
before
do
sign_in
(
user
)
end
...
...
spec/frontend/fixtures/raw.rb
View file @
993e93f9
...
...
@@ -9,14 +9,6 @@ RSpec.describe 'Raw files', '(JavaScript fixtures)' do
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
,
path:
'raw-project'
)
}
let
(
:response
)
{
@blob
.
data
.
force_encoding
(
'UTF-8'
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'blob/notebook/'
)
clean_frontend_fixtures
(
'blob/pdf/'
)
clean_frontend_fixtures
(
'blob/text/'
)
clean_frontend_fixtures
(
'blob/binary/'
)
clean_frontend_fixtures
(
'blob/images/'
)
end
after
do
remove_repository
(
project
)
end
...
...
spec/frontend/fixtures/releases.rb
View file @
993e93f9
...
...
@@ -116,10 +116,6 @@ RSpec.describe 'Releases (JavaScript fixtures)' do
end
describe
API
::
Releases
,
type: :request
do
before
(
:all
)
do
clean_frontend_fixtures
(
'api/releases/'
)
end
it
'api/releases/release.json'
do
get
api
(
"/projects/
#{
project
.
id
}
/releases/
#{
release
.
tag
}
"
,
admin
)
...
...
@@ -134,10 +130,6 @@ RSpec.describe 'Releases (JavaScript fixtures)' do
one_release_query_path
=
'releases/graphql/queries/one_release.query.graphql'
one_release_for_editing_query_path
=
'releases/graphql/queries/one_release_for_editing.query.graphql'
before
(
:all
)
do
clean_frontend_fixtures
(
'graphql/releases/'
)
end
it
"graphql/
#{
all_releases_query_path
}
.json"
do
query
=
get_graphql_query_as_string
(
all_releases_query_path
)
...
...
spec/frontend/fixtures/runner.rb
View file @
993e93f9
...
...
@@ -20,10 +20,6 @@ RSpec.describe 'Runner (JavaScript fixtures)' do
query_path
=
'runner/graphql/'
fixtures_path
=
'graphql/runner/'
before
(
:all
)
do
clean_frontend_fixtures
(
fixtures_path
)
end
after
(
:all
)
do
remove_repository
(
project
)
end
...
...
spec/frontend/fixtures/search.rb
View file @
993e93f9
...
...
@@ -9,10 +9,6 @@ RSpec.describe SearchController, '(JavaScript fixtures)', type: :controller do
let_it_be
(
:user
)
{
create
(
:user
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'search/'
)
end
before
do
sign_in
(
user
)
end
...
...
spec/frontend/fixtures/services.rb
View file @
993e93f9
...
...
@@ -12,10 +12,6 @@ RSpec.describe Projects::ServicesController, '(JavaScript fixtures)', type: :con
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'services/'
)
end
before
do
sign_in
(
user
)
end
...
...
spec/frontend/fixtures/sessions.rb
View file @
993e93f9
...
...
@@ -5,10 +5,6 @@ require 'spec_helper'
RSpec
.
describe
'Sessions (JavaScript fixtures)'
do
include
JavaScriptFixturesHelpers
before
(
:all
)
do
clean_frontend_fixtures
(
'sessions/'
)
end
describe
SessionsController
,
'(JavaScript fixtures)'
,
type: :controller
do
include
DeviseHelpers
...
...
spec/frontend/fixtures/snippet.rb
View file @
993e93f9
...
...
@@ -12,10 +12,6 @@ RSpec.describe SnippetsController, '(JavaScript fixtures)', type: :controller do
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'snippets/'
)
end
before
do
sign_in
(
user
)
allow
(
Discussion
).
to
receive
(
:build_discussion_id
).
and_return
([
'discussionid:ceterumcenseo'
])
...
...
spec/frontend/fixtures/startup_css.rb
View file @
993e93f9
...
...
@@ -9,10 +9,6 @@ RSpec.describe 'Startup CSS fixtures', type: :controller do
render_views
before
(
:all
)
do
clean_frontend_fixtures
(
'startup_css/'
)
end
shared_examples
'startup css project fixtures'
do
|
type
|
let
(
:user
)
{
create
(
:user
,
:admin
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
description:
'Code and stuff'
,
creator:
user
)
}
...
...
spec/frontend/fixtures/tags.rb
View file @
993e93f9
...
...
@@ -8,10 +8,6 @@ RSpec.describe 'Tags (JavaScript fixtures)' do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
path:
'tags-project'
)
}
let_it_be
(
:user
)
{
project
.
owner
}
before
(
:all
)
do
clean_frontend_fixtures
(
'api/tags/'
)
end
after
(
:all
)
do
remove_repository
(
project
)
end
...
...
spec/frontend/fixtures/timezones.rb
View file @
993e93f9
...
...
@@ -8,10 +8,6 @@ RSpec.describe TimeZoneHelper, '(JavaScript fixtures)' do
let
(
:response
)
{
@timezones
.
sort_by!
{
|
tz
|
tz
[
:name
]
}.
to_json
}
before
(
:all
)
do
clean_frontend_fixtures
(
'timezones/'
)
end
it
'timezones/short.json'
do
@timezones
=
timezone_data
(
format: :short
)
end
...
...
spec/frontend/fixtures/todos.rb
View file @
993e93f9
...
...
@@ -13,10 +13,6 @@ RSpec.describe 'Todos (JavaScript fixtures)' do
let
(
:issue_2
)
{
create
(
:issue
,
title:
'issue_2'
,
project:
project
)
}
let!
(
:todo_2
)
{
create
(
:todo
,
:done
,
user:
user
,
project:
project
,
target:
issue_2
,
created_at:
50
.
hours
.
ago
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'todos/'
)
end
after
do
remove_repository
(
project
)
end
...
...
spec/frontend/fixtures/u2f.rb
View file @
993e93f9
...
...
@@ -7,10 +7,6 @@ RSpec.context 'U2F' do
let
(
:user
)
{
create
(
:user
,
:two_factor_via_u2f
,
otp_secret:
'otpsecret:coolkids'
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'u2f/'
)
end
before
do
stub_feature_flags
(
webauthn:
false
)
end
...
...
spec/frontend/fixtures/webauthn.rb
View file @
993e93f9
...
...
@@ -7,10 +7,6 @@ RSpec.context 'WebAuthn' do
let
(
:user
)
{
create
(
:user
,
:two_factor_via_webauthn
,
otp_secret:
'otpsecret:coolkids'
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'webauthn/'
)
end
describe
SessionsController
,
'(JavaScript fixtures)'
,
type: :controller
do
include
DeviseHelpers
...
...
spec/support/helpers/javascript_fixtures_helpers.rb
View file @
993e93f9
...
...
@@ -3,6 +3,8 @@
require
'action_dispatch/testing/test_request'
require
'fileutils'
require_relative
'../../../lib/gitlab/popen'
module
JavaScriptFixturesHelpers
extend
ActiveSupport
::
Concern
include
Gitlab
::
Popen
...
...
@@ -25,15 +27,6 @@ module JavaScriptFixturesHelpers
'tmp/tests/frontend/fixtures'
+
(
Gitlab
.
ee?
?
'-ee'
:
''
)
end
# Public: Removes all fixture files from given directory
#
# directory_name - directory of the fixtures (relative to .fixture_root_path)
#
# TODO: Make sure this isn't called anymore.
def
clean_frontend_fixtures
(
directory_name
)
# We don't really need to cleanup fixtures, as this can be a problem when FOSS & EE fixtures try to generate files in the same folder.
end
def
remove_repository
(
project
)
Gitlab
::
Shell
.
new
.
remove_repository
(
project
.
repository_storage
,
project
.
disk_path
)
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