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
d74f5473
Commit
d74f5473
authored
Sep 10, 2012
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite dashboard feature steps using spinach
parent
bb75052a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
205 additions
and
17 deletions
+205
-17
features/dashboard/dashboard.feature
features/dashboard/dashboard.feature
+3
-4
features/dashboard/issues.feature
features/dashboard/issues.feature
+3
-3
features/dashboard/merge_requests.feature
features/dashboard/merge_requests.feature
+4
-4
features/dashboard/search.feature
features/dashboard/search.feature
+4
-6
features/steps/dashboard.rb
features/steps/dashboard.rb
+97
-0
features/steps/dashboard_issues.rb
features/steps/dashboard_issues.rb
+32
-0
features/steps/dashboard_merge_requests.rb
features/steps/dashboard_merge_requests.rb
+33
-0
features/steps/dashboard_search.rb
features/steps/dashboard_search.rb
+23
-0
features/support/env.rb
features/support/env.rb
+6
-0
No files found.
features/dashboard/dashboard.feature
View file @
d74f5473
Feature
:
Dashboard
Background
:
Given
I signin as a user
Background
:
Given
I sign
in as a user
And
I own project
"Shop"
And
project
"Shop"
has push event
And
I visit dashboard page
And
I visit dashboard page
Scenario
:
I
should see projects list
Then
I should see
"New Project"
link
...
...
@@ -25,4 +25,3 @@ Feature: Dashboard
And
user with name
"John Doe"
left project
"Shop"
When
I visit dashboard page
Then
I should see
"John Doe left project Shop"
event
features/dashboard/issues.feature
View file @
d74f5473
Feature
:
Dashboard Issues
Background
:
Given
I signin as a user
Background
:
Given
I sign
in as a user
And
I have assigned issues
And
I visit dashboard issues page
And
I visit dashboard issues page
Scenario
:
I
should see issues list
Then
I should see issues assigned to me
features/dashboard/merge_requests.feature
View file @
d74f5473
Feature
:
Dashboard M
R
Background
:
Given
I signin as a user
Feature
:
Dashboard M
erge Requests
Background
:
Given
I sign
in as a user
And
I have authored merge requests
And
I visit dashboard merge requests page
And
I visit dashboard merge requests page
Scenario
:
I
should see projects list
Then
I should see my merge requests
features/dashboard/search.feature
View file @
d74f5473
Feature
:
Dashboard Search
Background
:
Given
I signin as a user
Background
:
Given
I sign
in as a user
And
I own project
"Shop"
And
I visit dashboard search page
And
I visit dashboard search page
Scenario
:
I
should see project
i'
m looking for
Scenario
:
I
should see project
I a
m looking for
Given
I search for
"Sho"
Then
I should see
"Shop"
project link
features/steps/dashboard.rb
0 → 100644
View file @
d74f5473
class
Dashboard
<
Spinach
::
FeatureSteps
Then
'I should see "New Project" link'
do
page
.
should
have_link
"New Project"
end
Then
'I should see "Shop" project link'
do
page
.
should
have_link
"Shop"
end
Then
'I should see project "Shop" activity feed'
do
project
=
Project
.
find_by_name
(
"Shop"
)
page
.
should
have_content
"
#{
@user
.
name
}
pushed new branch new_design at
#{
project
.
name
}
"
end
Then
'I should see last push widget'
do
page
.
should
have_content
"Your pushed to branch new_design"
page
.
should
have_link
"Create Merge Request"
end
And
'I click "Create Merge Request" link'
do
click_link
"Create Merge Request"
end
Then
'I see prefilled new Merge Request page'
do
current_path
.
should
==
new_project_merge_request_path
(
@project
)
find
(
"#merge_request_source_branch"
).
value
.
should
==
"new_design"
find
(
"#merge_request_target_branch"
).
value
.
should
==
"master"
find
(
"#merge_request_title"
).
value
.
should
==
"New Design"
end
Given
'user with name "John Doe" joined project "Shop"'
do
user
=
Factory
.
create
(
:user
,
{
name:
"John Doe"
})
project
=
Project
.
find_by_name
"Shop"
Event
.
create
(
project:
project
,
author_id:
user
.
id
,
action:
Event
::
Joined
)
end
When
'I visit dashboard page'
do
visit
dashboard_path
end
Then
'I should see "John Doe joined project Shop" event'
do
page
.
should
have_content
"John Doe joined project Shop"
end
And
'user with name "John Doe" left project "Shop"'
do
user
=
User
.
find_by_name
"John Doe"
project
=
Project
.
find_by_name
"Shop"
Event
.
create
(
project:
project
,
author_id:
user
.
id
,
action:
Event
::
Left
)
end
Then
'I should see "John Doe left project Shop" event'
do
page
.
should
have_content
"John Doe left project Shop"
end
Given
'I sign in as a user'
do
login_as
:user
end
And
'I own project "Shop"'
do
@project
=
Factory
:project
,
:name
=>
'Shop'
@project
.
add_access
(
@user
,
:admin
)
end
And
'project "Shop" has push event'
do
@project
=
Project
.
find_by_name
(
"Shop"
)
data
=
{
:before
=>
"0000000000000000000000000000000000000000"
,
: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
end
features/steps/dashboard_issues.rb
0 → 100644
View file @
d74f5473
class
DashboardIssues
<
Spinach
::
FeatureSteps
Then
'I should see issues assigned to me'
do
issues
=
@user
.
issues
issues
.
each
do
|
issue
|
page
.
should
have_content
(
issue
.
title
[
0
..
10
])
page
.
should
have_content
(
issue
.
project
.
name
)
end
end
Given
'I sign in as a user'
do
login_as
:user
end
And
'I have assigned issues'
do
project
=
Factory
:project
project
.
add_access
(
@user
,
:read
,
:write
)
issue1
=
Factory
:issue
,
:author
=>
@user
,
:assignee
=>
@user
,
:project
=>
project
issue2
=
Factory
:issue
,
:author
=>
@user
,
:assignee
=>
@user
,
:project
=>
project
end
And
'I visit dashboard issues page'
do
visit
dashboard_issues_path
end
end
features/steps/dashboard_merge_requests.rb
0 → 100644
View file @
d74f5473
class
DashboardMergeRequests
<
Spinach
::
FeatureSteps
Then
'I should see my merge requests'
do
merge_requests
=
@user
.
merge_requests
merge_requests
.
each
do
|
mr
|
page
.
should
have_content
(
mr
.
title
[
0
..
10
])
page
.
should
have_content
(
mr
.
project
.
name
)
end
end
Given
'I sign in as a user'
do
login_as
:user
end
And
'I have authored merge requests'
do
project1
=
Factory
:project
project2
=
Factory
:project
project1
.
add_access
(
@user
,
:read
,
:write
)
project2
.
add_access
(
@user
,
:read
,
:write
)
merge_request1
=
Factory
:merge_request
,
:author
=>
@user
,
:project
=>
project1
merge_request2
=
Factory
:merge_request
,
:author
=>
@user
,
:project
=>
project2
end
And
'I visit dashboard merge requests page'
do
visit
dashboard_merge_requests_path
end
end
features/steps/dashboard_search.rb
0 → 100644
View file @
d74f5473
class
DashboardSearch
<
Spinach
::
FeatureSteps
Given
'I search for "Sho"'
do
fill_in
"dashboard_search"
,
:with
=>
"Sho"
click_button
"Search"
end
Then
'I should see "Shop" project link'
do
page
.
should
have_link
"Shop"
end
Given
'I sign in as a user'
do
login_as
:user
end
And
'I own project "Shop"'
do
@project
=
Factory
:project
,
:name
=>
"Shop"
@project
.
add_access
(
@user
,
:admin
)
end
And
'I visit dashboard search page'
do
visit
search_path
end
end
features/support/env.rb
View file @
d74f5473
...
...
@@ -4,6 +4,12 @@ require './config/environment'
require
'rspec'
require
'database_cleaner'
%w(login_helpers stubbed_repository)
.
each
do
|
f
|
require
Rails
.
root
.
join
(
'spec'
,
'support'
,
f
)
end
include
LoginHelpers
DatabaseCleaner
.
strategy
=
:transaction
Spinach
.
hooks
.
before_scenario
{
DatabaseCleaner
.
start
}
Spinach
.
hooks
.
after_scenario
{
DatabaseCleaner
.
clean
}
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