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
d79592a7
Commit
d79592a7
authored
May 15, 2013
by
AlexDenisov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added spec on bulk issues update
parent
31f007f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
spec/contexts/issues/bulk_update_context_spec.rb
spec/contexts/issues/bulk_update_context_spec.rb
+77
-0
No files found.
spec/contexts/issues/bulk_update_context_spec.rb
0 → 100644
View file @
d79592a7
require
'spec_helper'
describe
Issues
::
BulkUpdateContext
do
describe
:close_issue
do
before
do
@user
=
create
:user
opts
=
{
name:
"GitLab"
}
@project
=
create_project
(
@user
,
opts
)
@issues
=
5
.
times
.
collect
do
create
(
:issue
,
project:
@project
)
end
@params
=
{
update:
{
status:
'closed'
,
issues_ids:
@issues
.
map
(
&
:id
)
}
}
end
it
"close issues"
do
Issues
::
BulkUpdateContext
.
new
(
@project
,
@user
,
@params
).
execute
@project
.
issues
.
opened
.
should
be_empty
@project
.
issues
.
closed
.
should_not
be_empty
end
it
"return success"
do
result
=
Issues
::
BulkUpdateContext
.
new
(
@project
,
@user
,
@params
).
execute
result
[
:success
].
should
be_true
result
[
:count
].
should
==
@issues
.
count
end
end
describe
:reopen_issues
do
before
do
@user
=
create
:user
opts
=
{
name:
"GitLab"
}
@project
=
create_project
(
@user
,
opts
)
@issues
=
5
.
times
.
collect
do
create
(
:closed_issue
,
project:
@project
)
end
@params
=
{
update:
{
status:
'reopen'
,
issues_ids:
@issues
.
map
(
&
:id
)
}
}
end
it
"reopen issues"
do
Issues
::
BulkUpdateContext
.
new
(
@project
,
@user
,
@params
).
execute
@project
.
issues
.
closed
.
should
be_empty
@project
.
issues
.
opened
.
should_not
be_empty
end
it
"return success"
do
result
=
Issues
::
BulkUpdateContext
.
new
(
@project
,
@user
,
@params
).
execute
result
[
:success
].
should
be_true
result
[
:count
].
should
==
@issues
.
count
end
end
def
create_project
(
user
,
opts
)
Projects
::
CreateContext
.
new
(
user
,
opts
).
execute
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