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
Tatuya Kamada
gitlab-ce
Commits
2f6603e5
Commit
2f6603e5
authored
Jan 09, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bit of spinach tests
parent
ab344f31
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
116 additions
and
95 deletions
+116
-95
features/admin/logs.feature
features/admin/logs.feature
+0
-0
features/admin/projects.feature
features/admin/projects.feature
+13
-0
features/admin/users.feature
features/admin/users.feature
+0
-0
features/project/project.feature
features/project/project.feature
+14
-5
features/steps/admin/admin_projects.rb
features/steps/admin/admin_projects.rb
+24
-0
features/steps/dashboard/dashboard.rb
features/steps/dashboard/dashboard.rb
+1
-37
features/steps/project/project.rb
features/steps/project/project.rb
+13
-0
features/steps/shared/admin.rb
features/steps/shared/admin.rb
+8
-0
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+5
-0
features/steps/shared/project.rb
features/steps/shared/project.rb
+38
-0
spec/requests/projects_spec.rb
spec/requests/projects_spec.rb
+0
-53
No files found.
features/admin/logs.feature
0 → 100644
View file @
2f6603e5
features/admin/projects.feature
0 → 100644
View file @
2f6603e5
Feature
:
Admin Projects
Background
:
Given
I sign in as an admin
And
there are projects in system
Scenario
:
Projects list
When
I visit admin projects page
Then
I should see all projects
Scenario
:
Projects show
When
I visit admin projects page
And
I click on first project
Then
I should see project details
features/admin/users.feature
0 → 100644
View file @
2f6603e5
features/project/project.feature
View file @
2f6603e5
Feature
:
Projects
Feature
:
Projects
Background
:
Background
:
Given
I signin as a user
Given
I sign
in as a user
And
I own project
"Shop"
And
I own project
"Shop"
And
project
"Shop"
has push event
And
I visit project
"Shop"
page
And
I visit project
"Shop"
page
# @wip
Scenario
:
I
should see project activity
# Scenario: I should see project activity
When
I visit project
"Shop"
page
Then
I should see project
"Shop"
activity feed
# @wip
Scenario
:
I
visit edit project
# Scenario: I edit project
When
I visit edit project
"Shop"
page
Then
I should see project settings
Scenario
:
I
edit project
When
I visit edit project
"Shop"
page
And
change project settings
And
I save project
Then
I should see project with new settings
# @wip
# @wip
# Scenario: I visit attachments
# Scenario: I visit attachments
features/steps/admin/admin_projects.rb
0 → 100644
View file @
2f6603e5
class
AdminProjects
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedAdmin
And
'I should see all projects'
do
Project
.
all
.
each
do
|
p
|
page
.
should
have_content
p
.
name_with_namespace
end
end
And
'I click on first project'
do
click_link
Project
.
first
.
name_with_namespace
end
Then
'I should see project details'
do
project
=
Project
.
first
current_path
.
should
==
admin_project_path
(
project
)
page
.
should
have_content
(
project
.
name_with_namespace
)
page
.
should
have_content
(
project
.
creator
.
name
)
page
.
should
have_content
(
'Add new team member'
)
end
end
features/steps/dashboard/dashboard.rb
View file @
2f6603e5
class
Dashboard
<
Spinach
::
FeatureSteps
class
Dashboard
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedAuthentication
include
SharedPaths
include
SharedPaths
include
SharedProject
Then
'I should see "New Project" link'
do
Then
'I should see "New Project" link'
do
page
.
should
have_link
"New Project"
page
.
should
have_link
"New Project"
...
@@ -10,11 +11,6 @@ class Dashboard < Spinach::FeatureSteps
...
@@ -10,11 +11,6 @@ class Dashboard < Spinach::FeatureSteps
page
.
should
have_link
"Shop"
page
.
should
have_link
"Shop"
end
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
Then
'I should see last push widget'
do
page
.
should
have_content
"You pushed to new_design"
page
.
should
have_content
"You pushed to new_design"
page
.
should
have_link
"Create Merge Request"
page
.
should
have_link
"Create Merge Request"
...
@@ -59,11 +55,6 @@ class Dashboard < Spinach::FeatureSteps
...
@@ -59,11 +55,6 @@ class Dashboard < Spinach::FeatureSteps
page
.
should
have_content
"John Doe left project at Shop"
page
.
should
have_content
"John Doe left project at Shop"
end
end
And
'I own project "Shop"'
do
@project
=
create
:project
,
name:
'Shop'
@project
.
team
<<
[
@user
,
:master
]
end
And
'I have group with projects'
do
And
'I have group with projects'
do
@group
=
create
(
:group
)
@group
=
create
(
:group
)
@project
=
create
(
:project
,
group:
@group
)
@project
=
create
(
:project
,
group:
@group
)
...
@@ -72,32 +63,6 @@ class Dashboard < Spinach::FeatureSteps
...
@@ -72,32 +63,6 @@ class Dashboard < Spinach::FeatureSteps
@project
.
team
<<
[
current_user
,
:master
]
@project
.
team
<<
[
current_user
,
:master
]
end
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
Then
'I should see groups list'
do
Then
'I should see groups list'
do
Group
.
all
.
each
do
|
group
|
Group
.
all
.
each
do
|
group
|
page
.
should
have_link
group
.
name
page
.
should
have_link
group
.
name
...
@@ -112,5 +77,4 @@ class Dashboard < Spinach::FeatureSteps
...
@@ -112,5 +77,4 @@ class Dashboard < Spinach::FeatureSteps
Then
'I should see 1 project at group list'
do
Then
'I should see 1 project at group list'
do
page
.
find
(
'span.last_activity/span'
).
should
have_content
(
'1'
)
page
.
find
(
'span.last_activity/span'
).
should
have_content
(
'1'
)
end
end
end
end
features/steps/project/project.rb
View file @
2f6603e5
...
@@ -2,4 +2,17 @@ class Projects < Spinach::FeatureSteps
...
@@ -2,4 +2,17 @@ class Projects < Spinach::FeatureSteps
include
SharedAuthentication
include
SharedAuthentication
include
SharedProject
include
SharedProject
include
SharedPaths
include
SharedPaths
And
'change project settings'
do
fill_in
'project_name'
,
with:
'NewName'
uncheck
'project_issues_enabled'
end
And
'I save project'
do
click_button
'Save'
end
Then
'I should see project with new settings'
do
find_field
(
'project_name'
).
value
.
should
==
'NewName'
end
end
end
features/steps/shared/admin.rb
0 → 100644
View file @
2f6603e5
module
SharedAdmin
include
Spinach
::
DSL
And
'there are projects in system'
do
2
.
times
{
create
(
:project
)
}
end
end
features/steps/shared/paths.rb
View file @
2f6603e5
...
@@ -165,6 +165,11 @@ module SharedPaths
...
@@ -165,6 +165,11 @@ module SharedPaths
visit
project_path
(
project
)
visit
project_path
(
project
)
end
end
When
'I visit edit project "Shop" page'
do
project
=
Project
.
find_by_name
(
"Shop"
)
visit
edit_project_path
(
project
)
end
Given
'I visit project branches page'
do
Given
'I visit project branches page'
do
visit
branches_project_repository_path
(
@project
)
visit
branches_project_repository_path
(
@project
)
end
end
...
...
features/steps/shared/project.rb
View file @
2f6603e5
...
@@ -13,6 +13,44 @@ module SharedProject
...
@@ -13,6 +13,44 @@ module SharedProject
@project
.
team
<<
[
@user
,
:master
]
@project
.
team
<<
[
@user
,
:master
]
end
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
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 project settings'
do
current_path
.
should
==
edit_project_path
(
@project
)
page
.
should
have_content
(
"Project name is"
)
page
.
should
have_content
(
"Advanced settings:"
)
page
.
should
have_content
(
"Features:"
)
end
def
current_project
def
current_project
@project
||=
Project
.
first
@project
||=
Project
.
first
end
end
...
...
spec/requests/projects_spec.rb
View file @
2f6603e5
...
@@ -3,59 +3,6 @@ require 'spec_helper'
...
@@ -3,59 +3,6 @@ require 'spec_helper'
describe
"Projects"
do
describe
"Projects"
do
before
{
login_as
:user
}
before
{
login_as
:user
}
describe
"GET /projects/show"
do
before
do
@project
=
create
(
:project
,
namespace:
@user
.
namespace
)
@project
.
team
<<
[
@user
,
:reporter
]
visit
project_path
(
@project
)
end
it
"should be correct path"
do
current_path
.
should
==
project_path
(
@project
)
end
end
describe
"GET /projects/:id/edit"
do
before
do
@project
=
create
(
:project
)
@project
.
team
<<
[
@user
,
:master
]
visit
edit_project_path
(
@project
)
end
it
"should be correct path"
do
current_path
.
should
==
edit_project_path
(
@project
)
end
it
"should have labels for new project"
do
page
.
should
have_content
(
"Project name is"
)
page
.
should
have_content
(
"Advanced settings:"
)
page
.
should
have_content
(
"Features:"
)
end
end
describe
"PUT /projects/:id"
do
before
do
@project
=
create
(
:project
,
namespace:
@user
.
namespace
)
@project
.
team
<<
[
@user
,
:master
]
visit
edit_project_path
(
@project
)
fill_in
'project_name'
,
with:
'Awesome'
click_button
"Save"
@project
=
@project
.
reload
end
it
"should be correct path"
do
current_path
.
should
==
edit_project_path
(
@project
)
end
it
"should show project"
do
page
.
should
have_content
(
"Awesome"
)
end
end
describe
"DELETE /projects/:id"
do
describe
"DELETE /projects/:id"
do
before
do
before
do
@project
=
create
(
:project
,
namespace:
@user
.
namespace
)
@project
=
create
(
:project
,
namespace:
@user
.
namespace
)
...
...
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