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
f90db27e
Commit
f90db27e
authored
Nov 20, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add audit events feature spec for project.
parent
e348c651
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
4 deletions
+59
-4
app/controllers/audit_events_controller.rb
app/controllers/audit_events_controller.rb
+2
-2
app/views/audit_events/group_log.html.haml
app/views/audit_events/group_log.html.haml
+1
-1
app/views/audit_events/project_log.html.haml
app/views/audit_events/project_log.html.haml
+1
-1
features/project/project.feature
features/project/project.feature
+11
-0
features/steps/project/project.rb
features/steps/project/project.rb
+44
-0
No files found.
app/controllers/audit_events_controller.rb
View file @
f90db27e
...
@@ -8,11 +8,11 @@ class AuditEventsController < ApplicationController
...
@@ -8,11 +8,11 @@ class AuditEventsController < ApplicationController
layout
:determine_layout
layout
:determine_layout
def
project_log
def
project_log
@events
=
AuditEvent
.
where
(
entity_type:
"Project"
,
entity_id:
project
.
id
).
page
(
params
[
:page
]).
per
(
3
0
)
@events
=
AuditEvent
.
where
(
entity_type:
"Project"
,
entity_id:
project
.
id
).
page
(
params
[
:page
]).
per
(
2
0
)
end
end
def
group_log
def
group_log
@events
=
AuditEvent
.
where
(
entity_type:
"Group"
,
entity_id:
group
.
id
).
page
(
params
[
:page
]).
per
(
3
0
)
@events
=
AuditEvent
.
where
(
entity_type:
"Group"
,
entity_id:
group
.
id
).
page
(
params
[
:page
]).
per
(
2
0
)
end
end
private
private
...
...
app/views/audit_events/group_log.html.haml
View file @
f90db27e
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
%h3
.page-title
Group Audit Events
%h3
.page-title
Group Audit Events
%p
.light
Events in
#{
@group
.
name
}
%p
.light
Events in
#{
@group
.
name
}
%table
.table
%table
.table
#audits
%thead
%thead
%tr
%tr
%th
%th
...
...
app/views/audit_events/project_log.html.haml
View file @
f90db27e
%h3
.page-title
Project Audit Events
%h3
.page-title
Project Audit Events
%p
.light
Events in
#{
@project
.
path_with_namespace
}
%p
.light
Events in
#{
@project
.
path_with_namespace
}
%table
.table
%table
.table
#audits
%thead
%thead
%tr
%tr
%th
%th
...
...
features/project/project.feature
View file @
f90db27e
...
@@ -49,3 +49,14 @@ Feature: Project
...
@@ -49,3 +49,14 @@ Feature: Project
Then
I should see project
"Forum"
README
Then
I should see project
"Forum"
README
And
I visit project
"Shop"
page
And
I visit project
"Shop"
page
Then
I should see project
"Shop"
README
Then
I should see project
"Shop"
README
@javascript
Scenario
:
I
should see audit events
And
gitlab user
"Pete"
And
"Pete"
is
"Shop"
developer
When
I visit project
"Shop"
settings page
And
I go to
"Members"
Then
I change
"Pete"
access level to master
And
I visit project
"Shop"
settings page
And
I go to
"Audit Events"
Then
I should see the audit event listed
features/steps/project/project.rb
View file @
f90db27e
...
@@ -2,6 +2,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -2,6 +2,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
include
SharedAuthentication
include
SharedAuthentication
include
SharedProject
include
SharedProject
include
SharedPaths
include
SharedPaths
include
Select2Helper
step
'change project settings'
do
step
'change project settings'
do
fill_in
'project_name_edit'
,
with:
'NewName'
fill_in
'project_name_edit'
,
with:
'NewName'
...
@@ -69,4 +70,47 @@ class Spinach::Features::Project < Spinach::FeatureSteps
...
@@ -69,4 +70,47 @@ class Spinach::Features::Project < Spinach::FeatureSteps
page
.
should
have_link
"README.md"
page
.
should
have_link
"README.md"
page
.
should
have_content
"testme"
page
.
should
have_content
"testme"
end
end
step
'gitlab user "Pete"'
do
create
(
:user
,
name:
"Pete"
)
end
step
'"Pete" is "Shop" developer'
do
user
=
User
.
find_by
(
name:
"Pete"
)
project
=
Project
.
find_by
(
name:
"Shop"
)
project
.
team
<<
[
user
,
:developer
]
end
step
'I visit project "Shop" settings page'
do
click_link
'Settings'
end
step
'I go to "Members"'
do
click_link
'Members'
end
step
'I change "Pete" access level to master'
do
user
=
User
.
find_by
(
name:
"Pete"
)
within
"#user_
#{
user
.
id
}
"
do
select
"Master"
,
from:
"project_member_access_level"
end
end
step
'I go to "Audit Events"'
do
click_link
'Audit Events'
end
step
'I should see the audit event listed'
do
within
(
'table#audits tr:nth-child(1) td:nth-child(6)'
)
do
page
.
should
have_content
"Change access level from developer to master"
end
within
(
'table#audits tr:nth-child(1) td:nth-child(3)'
)
do
page
.
should
have_content
project
.
owner
.
name
end
within
(
'table#audits tr:nth-child(1) td:nth-child(8)'
)
do
page
.
should
have_content
'Pete'
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