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
0c6a47c6
Commit
0c6a47c6
authored
Dec 09, 2019
by
mo khan
Committed by
Ash McKenzie
Dec 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviewer feedback
parent
afd5cfef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
ee/spec/services/software_license_policies/create_service_spec.rb
...services/software_license_policies/create_service_spec.rb
+9
-15
No files found.
ee/spec/services/software_license_policies/create_service_spec.rb
View file @
0c6a47c6
...
@@ -30,15 +30,6 @@ describe SoftwareLicensePolicies::CreateService do
...
@@ -30,15 +30,6 @@ describe SoftwareLicensePolicies::CreateService do
end
end
context
'with a user who is allowed to admin'
do
context
'with a user who is allowed to admin'
do
it
'creates one software license policy correctly'
do
expect
{
subject
.
execute
}.
to
change
{
project
.
software_license_policies
.
count
}.
from
(
0
).
to
(
1
)
software_license_policy
=
project
.
software_license_policies
.
last
expect
(
software_license_policy
).
to
be_persisted
expect
(
software_license_policy
.
name
).
to
eq
(
params
[
:name
])
expect
(
software_license_policy
.
classification
).
to
eq
(
'denied'
)
end
context
'when valid parameters are specified'
do
context
'when valid parameters are specified'
do
where
(
:approval_status
,
:expected_classification
)
do
where
(
:approval_status
,
:expected_classification
)
do
[
[
...
@@ -57,12 +48,15 @@ describe SoftwareLicensePolicies::CreateService do
...
@@ -57,12 +48,15 @@ describe SoftwareLicensePolicies::CreateService do
result
result
end
end
specify
{
expect
(
result
[
:status
]).
to
be
(
:success
)
}
it
'creates one software license policy correctly'
do
specify
{
expect
(
result
[
:software_license_policy
]).
to
be_present
}
expect
(
project
.
software_license_policies
.
count
).
to
be
(
1
)
specify
{
expect
(
result
[
:software_license_policy
]).
to
be_persisted
}
expect
(
result
[
:status
]).
to
be
(
:success
)
specify
{
expect
(
result
[
:software_license_policy
].
name
).
to
eql
(
params
[
:name
])
}
expect
(
result
[
:software_license_policy
]).
to
be_present
specify
{
expect
(
result
[
:software_license_policy
].
classification
).
to
eql
(
expected_classification
)
}
expect
(
result
[
:software_license_policy
]).
to
be_persisted
specify
{
expect
(
RefreshLicenseComplianceChecksWorker
).
to
have_received
(
:perform_async
).
with
(
project
.
id
)
}
expect
(
result
[
:software_license_policy
].
name
).
to
eql
(
params
[
:name
])
expect
(
result
[
:software_license_policy
].
classification
).
to
eql
(
expected_classification
)
expect
(
RefreshLicenseComplianceChecksWorker
).
to
have_received
(
:perform_async
).
with
(
project
.
id
)
end
end
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