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
iv
gitlab-ce
Commits
081c272b
Commit
081c272b
authored
Feb 05, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove outdated specs and fixed key remove
parent
12198bee
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
27 deletions
+4
-27
app/observers/key_observer.rb
app/observers/key_observer.rb
+1
-0
lib/gitlab/backend/shell.rb
lib/gitlab/backend/shell.rb
+2
-2
spec/lib/gitolite_config_spec.rb
spec/lib/gitolite_config_spec.rb
+0
-16
spec/lib/gitolite_spec.rb
spec/lib/gitolite_spec.rb
+1
-9
No files found.
app/observers/key_observer.rb
View file @
081c272b
...
@@ -12,6 +12,7 @@ class KeyObserver < ActiveRecord::Observer
...
@@ -12,6 +12,7 @@ class KeyObserver < ActiveRecord::Observer
def
after_destroy
(
key
)
def
after_destroy
(
key
)
GitoliteWorker
.
perform_async
(
GitoliteWorker
.
perform_async
(
:remove_key
,
:remove_key
,
key
.
owner_name
,
key
.
key
,
key
.
key
,
)
)
end
end
...
...
lib/gitlab/backend/shell.rb
View file @
081c272b
...
@@ -38,8 +38,8 @@ module Gitlab
...
@@ -38,8 +38,8 @@ module Gitlab
# Ex.
# Ex.
# remove_key("sha-rsa")
# remove_key("sha-rsa")
#
#
def
remove_key
(
key_content
)
def
remove_key
(
username
,
key_content
)
system
(
"/home/git/gitlab-shell/bin/gitlab-keys rm-key
\"
#{
key_content
}
\"
"
)
system
(
"/home/git/gitlab-shell/bin/gitlab-keys rm-key
#{
username
}
\"
#{
key_content
}
\"
"
)
end
end
...
...
spec/lib/gitolite_config_spec.rb
deleted
100644 → 0
View file @
12198bee
require
'spec_helper'
describe
Gitlab
::
GitoliteConfig
do
let
(
:gitolite
)
{
Gitlab
::
GitoliteConfig
.
new
}
it
{
should
respond_to
:write_key
}
it
{
should
respond_to
:rm_key
}
it
{
should
respond_to
:update_project
}
it
{
should
respond_to
:update_project!
}
it
{
should
respond_to
:update_projects
}
it
{
should
respond_to
:destroy_project
}
it
{
should
respond_to
:destroy_project!
}
it
{
should
respond_to
:apply
}
it
{
should
respond_to
:admin_all_repo
}
it
{
should
respond_to
:admin_all_repo!
}
end
spec/lib/gitolite_spec.rb
View file @
081c272b
...
@@ -2,25 +2,17 @@ require 'spec_helper'
...
@@ -2,25 +2,17 @@ require 'spec_helper'
describe
Gitlab
::
Gitolite
do
describe
Gitlab
::
Gitolite
do
let
(
:project
)
{
double
(
'Project'
,
id:
7
,
path:
'diaspora'
)
}
let
(
:project
)
{
double
(
'Project'
,
id:
7
,
path:
'diaspora'
)
}
let
(
:gitolite_config
)
{
double
(
'Gitlab::GitoliteConfig'
)
}
let
(
:gitolite
)
{
Gitlab
::
Gitolite
.
new
}
let
(
:gitolite
)
{
Gitlab
::
Gitolite
.
new
}
before
do
before
do
gitolite
.
stub
(
config:
gitolite_config
)
Project
.
stub
(
find:
project
)
Project
.
stub
(
find:
project
)
end
end
it
{
should
respond_to
:set_key
}
it
{
should
respond_to
:set_key
}
it
{
should
respond_to
:remove_key
}
it
{
should
respond_to
:remove_key
}
it
{
should
respond_to
:update_repository
}
it
{
should
respond_to
:add_repository
}
it
{
should
respond_to
:create_repository
}
it
{
should
respond_to
:remove_repository
}
it
{
should
respond_to
:remove_repository
}
it
{
gitolite
.
url_to_repo
(
'diaspora'
).
should
==
Gitlab
.
config
.
gitolite
.
ssh_path_prefix
+
"diaspora.git"
}
it
{
gitolite
.
url_to_repo
(
'diaspora'
).
should
==
Gitlab
.
config
.
gitolite
.
ssh_path_prefix
+
"diaspora.git"
}
it
"should call config update"
do
gitolite_config
.
should_receive
(
:update_project!
)
gitolite
.
update_repository
(
project
.
id
)
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