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
76bcb1d9
Commit
76bcb1d9
authored
Jul 03, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new changes tests
parent
2d615c30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
spec/lib/ee/audit/changes_spec.rb
spec/lib/ee/audit/changes_spec.rb
+30
-0
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+1
-0
No files found.
spec/lib/ee/audit/changes_spec.rb
0 → 100644
View file @
76bcb1d9
require
'spec_helper'
describe
EE
::
Audit
::
Changes
do
describe
'.audit_changes'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:foo_class
)
{
Class
.
new
{
include
EE
::
Audit
::
Changes
}
}
before
do
allow_any_instance_of
(
foo_class
).
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
.
name
=
'new name'
foo_class
.
new
.
audit_changes
(
:email
)
end
end
describe
'audit changes'
do
it
'calls the audit event service'
do
expect_any_instance_of
(
AuditEventService
).
to
receive
(
:security_event
)
user
.
name
=
'new name'
foo_class
.
new
.
audit_changes
(
:name
)
end
end
end
end
spec/lib/gitlab/ldap/access_spec.rb
View file @
76bcb1d9
...
...
@@ -203,6 +203,7 @@ describe Gitlab::LDAP::Access do
it
'updates email address'
do
expect
(
access
).
to
receive
(
:update_email
).
once
expect
(
AuditEvents
.
count
).
to
eq
(
1
)
subject
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