BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
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