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
Jérome Perrin
gitlab-ce
Commits
8df63d15
Commit
8df63d15
authored
Apr 21, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update specs to accomodate issuable assign changes
parent
4adfd501
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
21 deletions
+31
-21
spec/services/issues/bulk_update_service_spec.rb
spec/services/issues/bulk_update_service_spec.rb
+1
-1
spec/services/issues/create_service_spec.rb
spec/services/issues/create_service_spec.rb
+14
-14
spec/services/issues/update_service_spec.rb
spec/services/issues/update_service_spec.rb
+8
-3
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+8
-3
No files found.
spec/services/issues/bulk_update_service_spec.rb
View file @
8df63d15
...
@@ -100,7 +100,7 @@ describe Issues::BulkUpdateService, services: true do
...
@@ -100,7 +100,7 @@ describe Issues::BulkUpdateService, services: true do
describe
:update_milestone
do
describe
:update_milestone
do
before
do
before
do
@milestone
=
create
:milestone
@milestone
=
create
(
:milestone
,
project:
@project
)
@params
=
{
@params
=
{
issues_ids:
[
issue
.
id
],
issues_ids:
[
issue
.
id
],
milestone_id:
@milestone
.
id
milestone_id:
@milestone
.
id
...
...
spec/services/issues/create_service_spec.rb
View file @
8df63d15
...
@@ -6,31 +6,31 @@ describe Issues::CreateService, services: true do
...
@@ -6,31 +6,31 @@ describe Issues::CreateService, services: true do
let
(
:assignee
)
{
create
(
:user
)
}
let
(
:assignee
)
{
create
(
:user
)
}
describe
:execute
do
describe
:execute
do
let
(
:issue
)
{
Issues
::
CreateService
.
new
(
project
,
user
,
opts
).
execute
}
context
'valid params'
do
context
'valid params'
do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
assignee
,
:master
]
project
.
team
<<
[
assignee
,
:master
]
end
opts
=
{
let
(
:opts
)
do
title:
'Awesome issue'
,
{
title:
'Awesome issue'
,
description:
'please fix'
,
description:
'please fix'
,
assignee:
assignee
assignee:
assignee
}
}
@issue
=
Issues
::
CreateService
.
new
(
project
,
user
,
opts
).
execute
end
end
it
{
expect
(
@
issue
).
to
be_valid
}
it
{
expect
(
issue
).
to
be_valid
}
it
{
expect
(
@
issue
.
title
).
to
eq
(
'Awesome issue'
)
}
it
{
expect
(
issue
.
title
).
to
eq
(
'Awesome issue'
)
}
it
{
expect
(
@
issue
.
assignee
).
to
eq
assignee
}
it
{
expect
(
issue
.
assignee
).
to
eq
assignee
}
it
'creates a pending todo for new assignee'
do
it
'creates a pending todo for new assignee'
do
attributes
=
{
attributes
=
{
project:
project
,
project:
project
,
author:
user
,
author:
user
,
user:
assignee
,
user:
assignee
,
target_id:
@
issue
.
id
,
target_id:
issue
.
id
,
target_type:
@
issue
.
class
.
name
,
target_type:
issue
.
class
.
name
,
action:
Todo
::
ASSIGNED
,
action:
Todo
::
ASSIGNED
,
state: :pending
state: :pending
}
}
...
@@ -39,8 +39,8 @@ describe Issues::CreateService, services: true do
...
@@ -39,8 +39,8 @@ describe Issues::CreateService, services: true do
end
end
context
'label that belongs to different project'
do
context
'label that belongs to different project'
do
let
(
:issue
)
{
Issues
::
CreateService
.
new
(
project
,
user
,
opts
).
execute
}
let
(
:label
)
{
create
(
:label
)
}
let
(
:label
)
{
create
(
:label
)
}
let
(
:opts
)
do
let
(
:opts
)
do
{
title:
'Title'
,
{
title:
'Title'
,
description:
'Description'
,
description:
'Description'
,
...
@@ -53,15 +53,15 @@ describe Issues::CreateService, services: true do
...
@@ -53,15 +53,15 @@ describe Issues::CreateService, services: true do
end
end
context
'milestone that belongs to different project'
do
context
'milestone that belongs to different project'
do
let
(
:issue
)
{
Issues
::
CreateService
.
new
(
project
,
user
,
opts
).
execute
}
let
(
:milestone
)
{
create
(
:milestone
)
}
let
(
:milestone
)
{
create
(
:milestone
)
}
let
(
:opts
)
do
let
(
:opts
)
do
{
title:
'Title'
,
{
title:
'Title'
,
description:
'Description'
,
description:
'Description'
,
milestone_id:
milestone
.
id
}
milestone_id:
milestone
.
id
}
end
end
it
'does not assign
label
'
do
it
'does not assign
milestone
'
do
expect
(
issue
.
milestone
).
to_not
eq
milestone
expect
(
issue
.
milestone
).
to_not
eq
milestone
end
end
end
end
...
...
spec/services/issues/update_service_spec.rb
View file @
8df63d15
...
@@ -4,10 +4,15 @@ describe Issues::UpdateService, services: true do
...
@@ -4,10 +4,15 @@ describe Issues::UpdateService, services: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:
issue
)
{
create
(
:issue
,
title:
'Old title'
,
assignee_id:
user3
.
id
)
}
let
(
:
project
)
{
create
(
:empty_project
)
}
let
(
:label
)
{
create
(
:label
)
}
let
(
:label
)
{
create
(
:label
,
project:
project
)
}
let
(
:label2
)
{
create
(
:label
)
}
let
(
:label2
)
{
create
(
:label
)
}
let
(
:project
)
{
issue
.
project
}
let
(
:issue
)
do
create
(
:issue
,
title:
'Old title'
,
assignee_id:
user3
.
id
,
project:
project
)
end
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
...
...
spec/services/merge_requests/update_service_spec.rb
View file @
8df63d15
require
'spec_helper'
require
'spec_helper'
describe
MergeRequests
::
UpdateService
,
services:
true
do
describe
MergeRequests
::
UpdateService
,
services:
true
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
title:
'Old title'
,
assignee_id:
user3
.
id
)
}
let
(
:label
)
{
create
(
:label
,
project:
project
)
}
let
(
:project
)
{
merge_request
.
project
}
let
(
:label
)
{
create
(
:label
)
}
let
(
:label2
)
{
create
(
:label
)
}
let
(
:label2
)
{
create
(
:label
)
}
let
(
:merge_request
)
do
create
(
:merge_request
,
:simple
,
title:
'Old title'
,
assignee_id:
user3
.
id
,
source_project:
project
)
end
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user2
,
:developer
]
project
.
team
<<
[
user2
,
:developer
]
...
...
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