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
Jérome Perrin
gitlab-ce
Commits
e45179c9
Commit
e45179c9
authored
Jun 22, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove useless routing tests. Added symlink creation for project with code
parent
248ece76
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
47 deletions
+18
-47
features/steps/project/project_fork.rb
features/steps/project/project_fork.rb
+2
-2
features/steps/shared/project.rb
features/steps/shared/project.rb
+2
-2
spec/factories.rb
spec/factories.rb
+7
-0
spec/features/search_spec.rb
spec/features/search_spec.rb
+2
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+1
-1
spec/routing/admin_routing_spec.rb
spec/routing/admin_routing_spec.rb
+0
-10
spec/routing/project_routing_spec.rb
spec/routing/project_routing_spec.rb
+0
-25
spec/support/login_helpers.rb
spec/support/login_helpers.rb
+4
-1
spec/support/test_env.rb
spec/support/test_env.rb
+0
-5
No files found.
features/steps/project/project_fork.rb
View file @
e45179c9
...
...
@@ -10,7 +10,7 @@ class ForkProject < Spinach::FeatureSteps
step
'I am a member of project "Shop"'
do
@project
=
Project
.
find_by_name
"Shop"
@project
||=
create
(
:project_with_code
,
name:
"Shop"
)
@project
||=
create
(
:project_with_code
,
name:
"Shop"
,
group:
create
(
:group
)
)
@project
.
team
<<
[
@user
,
:reporter
]
end
...
...
@@ -27,4 +27,4 @@ class ForkProject < Spinach::FeatureSteps
page
.
should
have_content
"Name has already been taken"
end
end
\ No newline at end of file
end
features/steps/shared/project.rb
View file @
e45179c9
...
...
@@ -3,14 +3,14 @@ module SharedProject
# Create a project without caring about what it's called
And
"I own a project"
do
@project
=
create
(
:project_with_code
)
@project
=
create
(
:project_with_code
,
namespace:
@user
.
namespace
)
@project
.
team
<<
[
@user
,
:master
]
end
# Create a specific project called "Shop"
And
'I own project "Shop"'
do
@project
=
Project
.
find_by_name
"Shop"
@project
||=
create
(
:project_with_code
,
name:
"Shop"
)
@project
||=
create
(
:project_with_code
,
name:
"Shop"
,
namespace:
@user
.
namespace
)
@project
.
team
<<
[
@user
,
:master
]
end
...
...
spec/factories.rb
View file @
e45179c9
...
...
@@ -36,6 +36,13 @@ FactoryGirl.define do
factory
:project_with_code
,
parent: :project
do
path
{
'gitlabhq'
}
after
:create
do
|
project
|
repos_path
=
Rails
.
root
.
join
(
'tmp'
,
'test-git-base-path'
)
seed_repo
=
Rails
.
root
.
join
(
'tmp'
,
'repositories'
,
'gitlabhq'
)
target_repo
=
File
.
join
(
repos_path
,
project
.
path_with_namespace
+
'.git'
)
system
(
"ln -s
#{
seed_repo
}
#{
target_repo
}
"
)
end
end
factory
:group
do
...
...
spec/features/search_spec.rb
View file @
e45179c9
...
...
@@ -2,8 +2,9 @@ require 'spec_helper'
describe
"Search"
do
before
do
ActiveRecord
::
Base
.
observers
.
enable
(
:user_observer
)
login_as
:user
@project
=
create
(
:project
)
@project
=
create
(
:project
,
namespace:
@user
.
namespace
)
@project
.
team
<<
[
@user
,
:reporter
]
visit
search_path
...
...
spec/requests/api/projects_spec.rb
View file @
e45179c9
...
...
@@ -8,7 +8,7 @@ describe API::API do
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let!
(
:project
)
{
create
(
:project_with_code
,
creator_id:
user
.
id
)
}
let!
(
:project
)
{
create
(
:project_with_code
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
let!
(
:hook
)
{
create
(
:project_hook
,
project:
project
,
url:
"http://example.com"
)
}
let!
(
:snippet
)
{
create
(
:project_snippet
,
author:
user
,
project:
project
,
title:
'example'
)
}
let!
(
:users_project
)
{
create
(
:users_project
,
user:
user
,
project:
project
,
project_access:
UsersProject
::
MASTER
)
}
...
...
spec/routing/admin_routing_spec.rb
View file @
e45179c9
...
...
@@ -75,18 +75,8 @@ describe Admin::ProjectsController, "routing" do
end
end
# edit_admin_project_member GET /admin/projects/:project_id/members/:id/edit(.:format) admin/projects/members#edit {id: /[^\/]+/, project_id: /[^\/]+/}
# admin_project_member PUT /admin/projects/:project_id/members/:id(.:format) admin/projects/members#update {id: /[^\/]+/, project_id: /[^\/]+/}
# DELETE /admin/projects/:project_id/members/:id(.:format) admin/projects/members#destroy {id: /[^\/]+/, project_id: /[^\/]+/}
describe
Admin
::
Projects
::
MembersController
,
"routing"
do
it
"to #edit"
do
get
(
"/admin/projects/test/members/1/edit"
).
should
route_to
(
'admin/projects/members#edit'
,
project_id:
'test'
,
id:
'1'
)
end
it
"to #update"
do
put
(
"/admin/projects/test/members/1"
).
should
route_to
(
'admin/projects/members#update'
,
project_id:
'test'
,
id:
'1'
)
end
it
"to #destroy"
do
delete
(
"/admin/projects/test/members/1"
).
should
route_to
(
'admin/projects/members#destroy'
,
project_id:
'test'
,
id:
'1'
)
end
...
...
spec/routing/project_routing_spec.rb
View file @
e45179c9
...
...
@@ -124,12 +124,7 @@ end
# branches_project_repository GET /:project_id/repository/branches(.:format) repositories#branches
# tags_project_repository GET /:project_id/repository/tags(.:format) repositories#tags
# archive_project_repository GET /:project_id/repository/archive(.:format) repositories#archive
# project_repository POST /:project_id/repository(.:format) repositories#create
# new_project_repository GET /:project_id/repository/new(.:format) repositories#new
# edit_project_repository GET /:project_id/repository/edit(.:format) repositories#edit
# GET /:project_id/repository(.:format) repositories#show
# PUT /:project_id/repository(.:format) repositories#update
# DELETE /:project_id/repository(.:format) repositories#destroy
describe
RepositoriesController
,
"routing"
do
it
"to #branches"
do
get
(
"/gitlabhq/repository/branches"
).
should
route_to
(
'repositories#branches'
,
project_id:
'gitlabhq'
)
...
...
@@ -143,29 +138,9 @@ describe RepositoriesController, "routing" do
get
(
"/gitlabhq/repository/archive"
).
should
route_to
(
'repositories#archive'
,
project_id:
'gitlabhq'
)
end
it
"to #create"
do
post
(
"/gitlabhq/repository"
).
should
route_to
(
'repositories#create'
,
project_id:
'gitlabhq'
)
end
it
"to #new"
do
get
(
"/gitlabhq/repository/new"
).
should
route_to
(
'repositories#new'
,
project_id:
'gitlabhq'
)
end
it
"to #edit"
do
get
(
"/gitlabhq/repository/edit"
).
should
route_to
(
'repositories#edit'
,
project_id:
'gitlabhq'
)
end
it
"to #show"
do
get
(
"/gitlabhq/repository"
).
should
route_to
(
'repositories#show'
,
project_id:
'gitlabhq'
)
end
it
"to #update"
do
put
(
"/gitlabhq/repository"
).
should
route_to
(
'repositories#update'
,
project_id:
'gitlabhq'
)
end
it
"to #destroy"
do
delete
(
"/gitlabhq/repository"
).
should
route_to
(
'repositories#destroy'
,
project_id:
'gitlabhq'
)
end
end
# project_deploy_keys GET /:project_id/deploy_keys(.:format) deploy_keys#index
...
...
spec/support/login_helpers.rb
View file @
e45179c9
...
...
@@ -3,7 +3,10 @@ module LoginHelpers
#
# role - User role (e.g., :admin, :user)
def
login_as
(
role
)
@user
=
create
(
role
)
ActiveRecord
::
Base
.
observers
.
enable
(
:user_observer
)
do
@user
=
create
(
role
)
end
login_with
(
@user
)
end
...
...
spec/support/test_env.rb
View file @
e45179c9
...
...
@@ -65,11 +65,6 @@ module TestEnv
# Recreate tmp/test-git-base-path
FileUtils
.
mkdir_p
Gitlab
.
config
.
gitlab_shell
.
repos_path
# Symlink tmp/repositories/gitlabhq to tmp/test-git-base-path/gitlabhq
seed_repo
=
Rails
.
root
.
join
(
'tmp'
,
'repositories'
,
'gitlabhq'
)
target_repo
=
File
.
join
(
repos_path
,
'gitlabhq.git'
)
system
(
"ln -s
#{
seed_repo
}
#{
target_repo
}
"
)
end
def
create_temp_repo
(
path
)
...
...
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