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
b2596805
Commit
b2596805
authored
Sep 15, 2021
by
atiwari71
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes the deactivation of DAST schedule above limit
DAST schedule should be deactivated above limit
parent
ab79e34a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
ee/app/models/dast/profile_schedule.rb
ee/app/models/dast/profile_schedule.rb
+2
-0
ee/spec/models/dast/profile_schedule_spec.rb
ee/spec/models/dast/profile_schedule_spec.rb
+7
-0
No files found.
ee/app/models/dast/profile_schedule.rb
View file @
b2596805
...
...
@@ -88,6 +88,8 @@ class Dast::ProfileSchedule < ApplicationRecord
# The will_save_change_to_active? returns false when the new object is created
# with the same value as the db defaults. That's why we need to this indirect to call validate_plan_limit_not_exceeded.
def
validate_plan_limit_not_exceeded_while_activating
return
if
active
==
false
validate_plan_limit_not_exceeded
end
end
ee/spec/models/dast/profile_schedule_spec.rb
View file @
b2596805
...
...
@@ -97,6 +97,13 @@ RSpec.describe Dast::ProfileSchedule, type: :model do
expect
{
inactive_schedule
.
save!
}.
to
raise_error
(
ActiveRecord
::
RecordInvalid
).
and
not_change
{
described_class
.
count
}
expect
(
inactive_schedule
.
errors
[
:base
]).
to
contain_exactly
(
"Maximum number of
#{
inactive_schedule
.
class
.
limit_name
.
humanize
(
capitalize:
false
)
}
(1) exceeded"
)
end
it
'allows the schedule to be deactivated'
,
:aggregate_failures
do
active_schedule
=
subject
.
dup
expect
{
active_schedule
.
save!
}.
to
change
{
described_class
.
count
}
expect
(
active_schedule
.
update
(
active:
false
)).
to
be
true
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