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
9cc7764a
Commit
9cc7764a
authored
Sep 12, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor and fix spec
parent
15df6af2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
spec/lib/ee/audit/changes_spec.rb
spec/lib/ee/audit/changes_spec.rb
+5
-6
No files found.
spec/lib/ee/audit/changes_spec.rb
View file @
9cc7764a
...
...
@@ -7,24 +7,23 @@ describe EE::Audit::Changes do
before
do
foo_instance
.
instance_variable_set
(
:@current_user
,
user
)
foo_instance
.
instance_variable_set
(
:@user
,
user
)
allow
(
foo_instance
).
to
receive
(
:model
).
and_return
(
user
)
end
describe
'non audit changes'
do
it
'does not call the audit event service'
do
expect_any_instance_of
(
AuditEventService
).
not_to
receive
(
:security_event
)
user
.
update!
(
name:
'new name'
)
foo_instance
.
audit_changes
(
:email
)
expect
{
foo_instance
.
audit_changes
(
:email
)
}.
not_to
change
{
SecurityEvent
.
count
}
end
end
describe
'audit changes'
do
it
'calls the audit event service'
do
expect_any_instance_of
(
AuditEventService
).
to
receive
(
:security_event
)
user
.
update!
(
name:
'new name'
)
foo_instance
.
audit_changes
(
:name
)
expect
{
foo_instance
.
audit_changes
(
:name
)
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
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