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
809a5f1d
Commit
809a5f1d
authored
Mar 25, 2021
by
Jason Goodman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor specs to use contains_exactly
parent
ddc17b0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
ee/spec/requests/groups_controller_spec.rb
ee/spec/requests/groups_controller_spec.rb
+10
-6
No files found.
ee/spec/requests/groups_controller_spec.rb
View file @
809a5f1d
...
...
@@ -31,9 +31,11 @@ RSpec.describe GroupsController, type: :request do
context
'valid param'
do
shared_examples
'creates ip restrictions'
do
it
'creates ip restrictions'
do
expect
{
subject
}
.
to
(
change
{
group
.
reload
.
ip_restrictions
.
map
(
&
:range
).
sort
}
.
from
([]).
to
(
range
.
split
(
','
).
sort
))
expect
(
group
.
ip_restrictions
).
to
be_empty
subject
expect
(
group
.
reload
.
ip_restrictions
.
map
(
&
:range
)).
to
contain_exactly
(
*
range
.
split
(
','
))
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
end
end
...
...
@@ -71,9 +73,11 @@ RSpec.describe GroupsController, type: :request do
context
'valid param'
do
shared_examples
'updates ip restrictions'
do
it
'updates ip restrictions'
do
expect
{
subject
}
.
to
(
change
{
group
.
reload
.
ip_restrictions
.
map
(
&
:range
).
sort
}
.
from
([
'10.0.0.0/8'
]).
to
(
range
.
split
(
','
).
sort
))
expect
(
group
.
ip_restrictions
.
map
(
&
:range
)).
to
eq
([
'10.0.0.0/8'
])
subject
expect
(
group
.
reload
.
ip_restrictions
.
map
(
&
:range
)).
to
contain_exactly
(
*
range
.
split
(
','
))
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
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