Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Mastodon
Commits
d848d8d8
Unverified
Commit
d848d8d8
authored
1 year ago
by
Matt Jankowski
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Add helper methods for domains allow and export blocks files (#28196)
parent
3ec263bf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
spec/controllers/admin/export_domain_allows_controller_spec.rb
+8
-2
8 additions, 2 deletions
...controllers/admin/export_domain_allows_controller_spec.rb
spec/controllers/admin/export_domain_blocks_controller_spec.rb
+7
-1
7 additions, 1 deletion
...controllers/admin/export_domain_blocks_controller_spec.rb
with
15 additions
and
3 deletions
spec/controllers/admin/export_domain_allows_controller_spec.rb
+
8
−
2
View file @
d848d8d8
...
@@ -24,7 +24,7 @@ RSpec.describe Admin::ExportDomainAllowsController do
...
@@ -24,7 +24,7 @@ RSpec.describe Admin::ExportDomainAllowsController do
get
:export
,
params:
{
format: :csv
}
get
:export
,
params:
{
format: :csv
}
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
.
body
).
to
eq
(
File
.
read
(
File
.
join
(
file_fixture_path
,
'
domain_allows
.
csv
'
))
)
expect
(
response
.
body
).
to
eq
(
domain_allows
_
csv
_file
)
end
end
end
end
...
@@ -40,7 +40,7 @@ RSpec.describe Admin::ExportDomainAllowsController do
...
@@ -40,7 +40,7 @@ RSpec.describe Admin::ExportDomainAllowsController do
# Domains should now be added
# Domains should now be added
get
:export
,
params:
{
format: :csv
}
get
:export
,
params:
{
format: :csv
}
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
.
body
).
to
eq
(
File
.
read
(
File
.
join
(
file_fixture_path
,
'
domain_allows
.
csv
'
))
)
expect
(
response
.
body
).
to
eq
(
domain_allows
_
csv
_file
)
end
end
it
'displays error on no file selected'
do
it
'displays error on no file selected'
do
...
@@ -49,4 +49,10 @@ RSpec.describe Admin::ExportDomainAllowsController do
...
@@ -49,4 +49,10 @@ RSpec.describe Admin::ExportDomainAllowsController do
expect
(
flash
[
:error
]).
to
eq
(
I18n
.
t
(
'admin.export_domain_allows.no_file'
))
expect
(
flash
[
:error
]).
to
eq
(
I18n
.
t
(
'admin.export_domain_allows.no_file'
))
end
end
end
end
private
def
domain_allows_csv_file
File
.
read
(
File
.
join
(
file_fixture_path
,
'domain_allows.csv'
))
end
end
end
This diff is collapsed.
Click to expand it.
spec/controllers/admin/export_domain_blocks_controller_spec.rb
+
7
−
1
View file @
d848d8d8
...
@@ -26,7 +26,13 @@ RSpec.describe Admin::ExportDomainBlocksController do
...
@@ -26,7 +26,13 @@ RSpec.describe Admin::ExportDomainBlocksController do
get
:export
,
params:
{
format: :csv
}
get
:export
,
params:
{
format: :csv
}
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
.
body
).
to
eq
(
File
.
read
(
File
.
join
(
file_fixture_path
,
'domain_blocks.csv'
)))
expect
(
response
.
body
).
to
eq
(
domain_blocks_csv_file
)
end
private
def
domain_blocks_csv_file
File
.
read
(
File
.
join
(
file_fixture_path
,
'domain_blocks.csv'
))
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment