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
5a2ae296
Commit
5a2ae296
authored
Dec 10, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix observer specs
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
5289190c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
24 deletions
+17
-24
spec/observers/issue_observer_spec.rb
spec/observers/issue_observer_spec.rb
+1
-1
spec/observers/merge_request_observer_spec.rb
spec/observers/merge_request_observer_spec.rb
+1
-1
spec/observers/user_observer_spec.rb
spec/observers/user_observer_spec.rb
+1
-1
spec/observers/users_group_observer_spec.rb
spec/observers/users_group_observer_spec.rb
+1
-1
spec/observers/users_project_observer_spec.rb
spec/observers/users_project_observer_spec.rb
+13
-20
No files found.
spec/observers/issue_observer_spec.rb
View file @
5a2ae296
...
...
@@ -9,7 +9,7 @@ describe IssueObserver do
before
{
subject
.
stub
(
:current_user
).
and_return
(
some_user
)
}
before
{
subject
.
stub
(
:current_commit
).
and_return
(
nil
)
}
before
{
subject
.
stub
(
notification:
mock
(
'NotificationService'
).
as_null_object
)
}
before
{
subject
.
stub
(
notification:
double
(
'NotificationService'
).
as_null_object
)
}
before
{
mock_issue
.
project
.
stub_chain
(
:repository
,
:commit
).
and_return
(
nil
)
}
subject
{
IssueObserver
.
instance
}
...
...
spec/observers/merge_request_observer_spec.rb
View file @
5a2ae296
...
...
@@ -11,7 +11,7 @@ describe MergeRequestObserver do
let
(
:closed_unassigned_mr
)
{
create
(
:closed_merge_request
,
author:
author
,
target_project:
create
(
:project
))
}
before
{
subject
.
stub
(
:current_user
).
and_return
(
some_user
)
}
before
{
subject
.
stub
(
notification:
mock
(
'NotificationService'
).
as_null_object
)
}
before
{
subject
.
stub
(
notification:
double
(
'NotificationService'
).
as_null_object
)
}
before
{
mr_mock
.
stub
(
:author_id
)
}
before
{
mr_mock
.
stub
(
:target_project
)
}
before
{
mr_mock
.
stub
(
:source_project
)
}
...
...
spec/observers/user_observer_spec.rb
View file @
5a2ae296
...
...
@@ -4,7 +4,7 @@ describe UserObserver do
before
(
:each
)
{
enable_observers
}
after
(
:each
)
{
disable_observers
}
subject
{
UserObserver
.
instance
}
before
{
subject
.
stub
(
notification:
mock
(
'NotificationService'
).
as_null_object
)
}
before
{
subject
.
stub
(
notification:
double
(
'NotificationService'
).
as_null_object
)
}
it
'calls #after_create when new users are created'
do
new_user
=
build
(
:user
)
...
...
spec/observers/users_group_observer_spec.rb
View file @
5a2ae296
...
...
@@ -5,7 +5,7 @@ describe UsersGroupObserver do
after
(
:each
)
{
disable_observers
}
subject
{
UsersGroupObserver
.
instance
}
before
{
subject
.
stub
(
notification:
mock
(
'NotificationService'
).
as_null_object
)
}
before
{
subject
.
stub
(
notification:
double
(
'NotificationService'
).
as_null_object
)
}
describe
"#after_create"
do
it
"should send email to user"
do
...
...
spec/observers/users_project_observer_spec.rb
View file @
5a2ae296
...
...
@@ -9,26 +9,6 @@ describe UsersProjectObserver do
subject
{
UsersProjectObserver
.
instance
}
before
{
subject
.
stub
(
notification:
double
(
'NotificationService'
).
as_null_object
)
}
describe
"#after_commit"
do
it
"should called when UsersProject created"
do
subject
.
should_receive
(
:after_commit
)
create
(
:users_project
)
end
it
"should send email to user"
do
subject
.
should_receive
(
:notification
)
Event
.
stub
(
create:
true
)
create
(
:users_project
)
end
it
"should create new event"
do
Event
.
should_receive
(
:create
)
create
(
:users_project
)
end
end
describe
"#after_update"
do
before
do
@users_project
=
create
:users_project
...
...
@@ -90,5 +70,18 @@ describe UsersProjectObserver do
it
{
File
.
exists?
(
@path
).
should
be_false
}
end
end
it
"should send email to user"
do
subject
.
should_receive
(
:notification
)
Event
.
stub
(
create:
true
)
create
(
:users_project
)
end
it
"should create new event"
do
Event
.
should_receive
(
:create
)
create
(
:users_project
)
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