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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
591cb609
Commit
591cb609
authored
Jul 05, 2017
by
Alexander Randa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaces 'dashboard/activity.feature' spinach with rspec
parent
cd735170
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
157 additions
and
154 deletions
+157
-154
changelogs/unreleased/23036-replace-dashboard-event-filters-spinach.yml
...eleased/23036-replace-dashboard-event-filters-spinach.yml
+4
-0
features/dashboard/event_filters.feature
features/dashboard/event_filters.feature
+0
-58
features/steps/dashboard/event_filters.rb
features/steps/dashboard/event_filters.rb
+0
-92
spec/features/dashboard/activity_spec.rb
spec/features/dashboard/activity_spec.rb
+153
-4
No files found.
changelogs/unreleased/23036-replace-dashboard-event-filters-spinach.yml
0 → 100644
View file @
591cb609
---
title
:
Replaces dashboard/event_filters.feature spinach with rspec
merge_request
:
12651
author
:
Alexander Randa (@randaalex)
features/dashboard/event_filters.feature
deleted
100644 → 0
View file @
cd735170
@dashboard
Feature
:
Event Filters
Background
:
Given
I sign in as a user
And
I own a project
And
this project has push event
And
this project has new member event
And
this project has merge request event
And
I visit dashboard activity page
@javascript
Scenario
:
I
should see all events
Then
I should see push event
And
I should see new member event
And
I should see merge request event
@javascript
Scenario
:
I
should see only pushed events
When
I click
"push"
event filter
Then
I should see push event
And
I should not see new member event
And
I should not see merge request event
@javascript
Scenario
:
I
should see only joined events
When
I click
"team"
event filter
Then
I should see new member event
And
I should not see push event
And
I should not see merge request event
@javascript
Scenario
:
I
should see only merged events
When
I click
"merge"
event filter
Then
I should see merge request event
And
I should not see push event
And
I should not see new member event
@javascript
Scenario
:
I
should see only selected events while page reloaded
When
I click
"push"
event filter
And
I visit dashboard activity page
Then
I should see push event
And
I should not see new member event
When
I click
"team"
event filter
And
I visit dashboard activity page
Then
I should not see push event
And
I should see new member event
And
I should not see merge request event
When
I click
"push"
event filter
And
I visit dashboard activity page
Then
I should see push event
And
I should not see new member event
And
I should not see merge request event
When
I click
"merge"
event filter
And
I visit dashboard activity page
Then
I should see merge request event
And
I should not see push event
And
I should not see new member event
features/steps/dashboard/event_filters.rb
deleted
100644 → 0
View file @
cd735170
class
Spinach::Features::EventFilters
<
Spinach
::
FeatureSteps
include
WaitForRequests
include
SharedAuthentication
include
SharedPaths
include
SharedProject
step
'I should see push event'
do
expect
(
page
).
to
have_selector
(
'span.pushed'
)
end
step
'I should not see push event'
do
expect
(
page
).
not_to
have_selector
(
'span.pushed'
)
end
step
'I should see new member event'
do
expect
(
page
).
to
have_selector
(
'span.joined'
)
end
step
'I should not see new member event'
do
expect
(
page
).
not_to
have_selector
(
'span.joined'
)
end
step
'I should see merge request event'
do
expect
(
page
).
to
have_selector
(
'span.accepted'
)
end
step
'I should not see merge request event'
do
expect
(
page
).
not_to
have_selector
(
'span.accepted'
)
end
step
'this project has push event'
do
data
=
{
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
ref:
"refs/heads/new_design"
,
user_id:
@user
.
id
,
user_name:
@user
.
name
,
repository:
{
name:
@project
.
name
,
url:
"localhost/rubinius"
,
description:
""
,
homepage:
"localhost/rubinius"
,
private:
true
}
}
@event
=
Event
.
create
(
project:
@project
,
action:
Event
::
PUSHED
,
data:
data
,
author_id:
@user
.
id
)
end
step
'this project has new member event'
do
user
=
create
(
:user
,
{
name:
"John Doe"
})
Event
.
create
(
project:
@project
,
author_id:
user
.
id
,
action:
Event
::
JOINED
)
end
step
'this project has merge request event'
do
merge_request
=
create
:merge_request
,
author:
@user
,
source_project:
@project
,
target_project:
@project
Event
.
create
(
project:
@project
,
action:
Event
::
MERGED
,
target_id:
merge_request
.
id
,
target_type:
"MergeRequest"
,
author_id:
@user
.
id
)
end
When
'I click "push" event filter'
do
wait_for_requests
click_link
(
"Push events"
)
wait_for_requests
end
When
'I click "team" event filter'
do
wait_for_requests
click_link
(
"Team"
)
wait_for_requests
end
When
'I click "merge" event filter'
do
wait_for_requests
click_link
(
"Merge events"
)
wait_for_requests
end
end
spec/features/dashboard/activity_spec.rb
View file @
591cb609
require
'spec_helper'
RSpec
.
describe
'Dashboard Activity'
,
feature:
true
do
feature
'Dashboard > Activity'
do
let
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
visit
activity_dashboard_path
end
it_behaves_like
"it has an RSS button with current_user's RSS token"
it_behaves_like
"an autodiscoverable RSS feed with current_user's RSS token"
context
'rss'
do
before
do
visit
activity_dashboard_path
end
it_behaves_like
"it has an RSS button with current_user's RSS token"
it_behaves_like
"an autodiscoverable RSS feed with current_user's RSS token"
end
context
'event filters'
,
:js
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:merge_request
)
do
create
(
:merge_request
,
author:
user
,
source_project:
project
,
target_project:
project
)
end
let
(
:push_event_data
)
do
{
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
'0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e'
,
ref:
'refs/heads/new_design'
,
user_id:
user
.
id
,
user_name:
user
.
name
,
repository:
{
name:
project
.
name
,
url:
'localhost/rubinius'
,
description:
''
,
homepage:
'localhost/rubinius'
,
private:
true
}
}
end
let
(
:note
)
{
create
(
:note
,
project:
project
,
noteable:
merge_request
)
}
let!
(
:push_event
)
do
create
(
:event
,
:pushed
,
data:
push_event_data
,
project:
project
,
author:
user
)
end
let!
(
:merged_event
)
do
create
(
:event
,
:merged
,
project:
project
,
target:
merge_request
,
author:
user
)
end
let!
(
:joined_event
)
do
create
(
:event
,
:joined
,
project:
project
,
author:
user
)
end
let!
(
:closed_event
)
do
create
(
:event
,
:closed
,
project:
project
,
target:
merge_request
,
author:
user
)
end
let!
(
:comments_event
)
do
create
(
:event
,
:commented
,
project:
project
,
target:
note
,
author:
user
)
end
before
do
project
.
add_master
(
user
)
visit
activity_dashboard_path
wait_for_requests
end
scenario
'user should see all events'
do
within
'.content_list'
do
expect
(
page
).
to
have_content
(
'pushed new branch'
)
expect
(
page
).
to
have_content
(
'joined'
)
expect
(
page
).
to
have_content
(
'accepted'
)
expect
(
page
).
to
have_content
(
'closed'
)
expect
(
page
).
to
have_content
(
'commented on'
)
end
end
scenario
'user should see only pushed events'
do
click_link
(
'Push events'
)
wait_for_requests
within
'.content_list'
do
expect
(
page
).
to
have_content
(
'pushed new branch'
)
expect
(
page
).
not_to
have_content
(
'joined'
)
expect
(
page
).
not_to
have_content
(
'accepted'
)
expect
(
page
).
not_to
have_content
(
'closed'
)
expect
(
page
).
not_to
have_content
(
'commented on'
)
end
end
scenario
'user should see only merged events'
do
click_link
(
'Merge events'
)
wait_for_requests
within
'.content_list'
do
expect
(
page
).
not_to
have_content
(
'pushed new branch'
)
expect
(
page
).
not_to
have_content
(
'joined'
)
expect
(
page
).
to
have_content
(
'accepted'
)
expect
(
page
).
not_to
have_content
(
'closed'
)
expect
(
page
).
not_to
have_content
(
'commented on'
)
end
end
scenario
'user should see only issues events'
do
click_link
(
'Issue events'
)
wait_for_requests
within
'.content_list'
do
expect
(
page
).
not_to
have_content
(
'pushed new branch'
)
expect
(
page
).
not_to
have_content
(
'joined'
)
expect
(
page
).
not_to
have_content
(
'accepted'
)
expect
(
page
).
to
have_content
(
'closed'
)
expect
(
page
).
not_to
have_content
(
'commented on'
)
end
end
scenario
'user should see only comments events'
do
click_link
(
'Comments'
)
wait_for_requests
within
'.content_list'
do
expect
(
page
).
not_to
have_content
(
'pushed new branch'
)
expect
(
page
).
not_to
have_content
(
'joined'
)
expect
(
page
).
not_to
have_content
(
'accepted'
)
expect
(
page
).
not_to
have_content
(
'closed'
)
expect
(
page
).
to
have_content
(
'commented on'
)
end
end
scenario
'user should see only joined events'
do
click_link
(
'Team'
)
wait_for_requests
within
'.content_list'
do
expect
(
page
).
not_to
have_content
(
'pushed new branch'
)
expect
(
page
).
to
have_content
(
'joined'
)
expect
(
page
).
not_to
have_content
(
'accepted'
)
expect
(
page
).
not_to
have_content
(
'closed'
)
expect
(
page
).
not_to
have_content
(
'commented on'
)
end
end
scenario
'user see selected event after page reloading'
do
click_link
(
'Push events'
)
wait_for_requests
visit
activity_dashboard_path
wait_for_requests
within
'.content_list'
do
expect
(
page
).
to
have_content
(
'pushed new branch'
)
expect
(
page
).
not_to
have_content
(
'joined'
)
expect
(
page
).
not_to
have_content
(
'accepted'
)
expect
(
page
).
not_to
have_content
(
'closed'
)
expect
(
page
).
not_to
have_content
(
'commented on'
)
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