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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
02c4a0cc
Commit
02c4a0cc
authored
Aug 06, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for abuse report feature
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
ed7a8c92
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
0 deletions
+67
-0
features/abuse_report.feature
features/abuse_report.feature
+10
-0
features/admin/abuse_report.feature
features/admin/abuse_report.feature
+8
-0
features/steps/abuse_reports.rb
features/steps/abuse_reports.rb
+28
-0
features/steps/admin/abuse_reports.rb
features/steps/admin/abuse_reports.rb
+17
-0
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+4
-0
No files found.
features/abuse_report.feature
0 → 100644
View file @
02c4a0cc
Feature
:
Abuse reports
Background
:
Given
I sign in as a user
And
user
"Mike"
exists
Scenario
:
Report abuse
Given
I visit
"Mike"
user page
And
I click
"Report abuse"
button
When
I fill and submit abuse form
Then
I should see success message
features/admin/abuse_report.feature
0 → 100644
View file @
02c4a0cc
Feature
:
Admin Abuse reports
Background
:
Given
I sign in as an admin
And
abuse reports exist
Scenario
:
Browse abuse reports
When
I visit abuse reports page
Then
I should see list of abuse reports
features/steps/abuse_reports.rb
0 → 100644
View file @
02c4a0cc
class
Spinach::Features::AbuseReports
<
Spinach
::
FeatureSteps
include
SharedAuthentication
step
'I visit "Mike" user page'
do
visit
user_path
(
user_mike
)
end
step
'I click "Report abuse" button'
do
click_link
'Report abuse'
end
step
'I fill and submit abuse form'
do
fill_in
'abuse_report_message'
,
with:
'This user send spam'
click_button
'Send report'
end
step
'I should see success message'
do
page
.
should
have_content
'Thank you for your report'
end
step
'user "Mike" exists'
do
user_mike
end
def
user_mike
@user_mike
||=
create
(
:user
,
name:
'Mike'
)
end
end
features/steps/admin/abuse_reports.rb
0 → 100644
View file @
02c4a0cc
class
Spinach::Features::AdminAbuseReports
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedAdmin
step
'I should see list of abuse reports'
do
page
.
should
have_content
(
"Abuse Reports"
)
page
.
should
have_content
AbuseReport
.
first
.
message
page
.
should
have_link
(
"Remove user"
)
end
step
'abuse reports exist'
do
create
(
:abuse_report
)
end
end
features/steps/shared/paths.rb
View file @
02c4a0cc
...
...
@@ -139,6 +139,10 @@ module SharedPaths
visit
admin_root_path
end
step
'I visit abuse reports page'
do
visit
admin_abuse_reports_path
end
step
'I visit admin projects page'
do
visit
admin_namespaces_projects_path
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