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
Kazuhiko Shiozaki
gitlab-ce
Commits
1c931fb8
Commit
1c931fb8
authored
Jan 28, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix key observer tests
parent
299a9a10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
+3
-9
app/observers/project_observer.rb
app/observers/project_observer.rb
+1
-1
spec/observers/key_observer_spec.rb
spec/observers/key_observer_spec.rb
+2
-8
No files found.
app/observers/project_observer.rb
View file @
1c931fb8
...
@@ -15,7 +15,7 @@ class ProjectObserver < ActiveRecord::Observer
...
@@ -15,7 +15,7 @@ class ProjectObserver < ActiveRecord::Observer
end
end
def
after_create
project
def
after_create
project
log_info
(
"
#{
project
.
owner
.
name
}
created a new project
\"
#{
project
.
name
}
\"
"
)
log_info
(
"
#{
project
.
owner
.
name
}
created a new project
\"
#{
project
.
name
_with_namespace
}
\"
"
)
end
end
protected
protected
...
...
spec/observers/key_observer_spec.rb
View file @
1c931fb8
...
@@ -9,25 +9,19 @@ describe KeyObserver do
...
@@ -9,25 +9,19 @@ describe KeyObserver do
is_deploy_key:
false
is_deploy_key:
false
)
)
@gitolite
=
double
(
'Gitlab::Gitolite'
,
set_key:
true
,
remove_key:
true
)
@observer
=
KeyObserver
.
instance
@observer
=
KeyObserver
.
instance
@observer
.
stub
(
gitolite:
@gitolite
)
end
end
context
:after_save
do
context
:after_save
do
it
do
it
do
@gitolite
.
should_receive
(
:set_key
).
with
(
@key
.
identifier
,
@key
.
key
,
@key
.
projects
)
GitoliteWorker
.
should_receive
(
:perform_async
).
with
(
:set_key
,
@key
.
identifier
,
@key
.
key
,
@key
.
projects
.
map
(
&
:id
)
)
@observer
.
after_save
(
@key
)
@observer
.
after_save
(
@key
)
end
end
end
end
context
:after_destroy
do
context
:after_destroy
do
it
do
it
do
@gitolite
.
should_receive
(
:remove_key
).
with
(
@key
.
identifier
,
@key
.
projects
)
GitoliteWorker
.
should_receive
(
:perform_async
).
with
(
:remove_key
,
@key
.
identifier
,
@key
.
projects
.
map
(
&
:id
)
)
@observer
.
after_destroy
(
@key
)
@observer
.
after_destroy
(
@key
)
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