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
Léo-Paul Géneau
gitlab-ce
Commits
02fed9a9
Commit
02fed9a9
authored
Aug 31, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport specs
parent
8077b728
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
11 deletions
+34
-11
spec/controllers/boards/issues_controller_spec.rb
spec/controllers/boards/issues_controller_spec.rb
+23
-9
spec/controllers/boards/lists_controller_spec.rb
spec/controllers/boards/lists_controller_spec.rb
+1
-1
spec/factories/milestones.rb
spec/factories/milestones.rb
+4
-0
spec/fixtures/api/schemas/issue.json
spec/fixtures/api/schemas/issue.json
+5
-0
spec/services/boards/issues/create_service_spec.rb
spec/services/boards/issues/create_service_spec.rb
+1
-1
No files found.
spec/controllers/boards/issues_controller_spec.rb
View file @
02fed9a9
require
'spec_helper'
describe
Projects
::
Boards
::
IssuesController
do
describe
Boards
::
IssuesController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:board
)
{
create
(
:board
,
project:
project
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
@@ -133,6 +133,22 @@ describe Projects::Boards::IssuesController do
expect
(
response
).
to
have_http_status
(
404
)
end
end
context
'with invalid board id'
do
it
'returns a not found 404 response'
do
create_issue
user:
user
,
board:
999
,
list:
list1
,
title:
'New issue'
expect
(
response
).
to
have_http_status
(
404
)
end
end
context
'with invalid list id'
do
it
'returns a not found 404 response'
do
create_issue
user:
user
,
board:
board
,
list:
999
,
title:
'New issue'
expect
(
response
).
to
have_http_status
(
404
)
end
end
end
context
'with unauthorized user'
do
...
...
@@ -146,17 +162,15 @@ describe Projects::Boards::IssuesController do
def
create_issue
(
user
:,
board
:,
list
:,
title
:)
sign_in
(
user
)
post
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
board_id:
board
.
to_param
,
post
:create
,
board_id:
board
.
to_param
,
list_id:
list
.
to_param
,
issue:
{
title:
title
},
issue:
{
title:
title
,
project_id:
project
.
id
},
format: :json
end
end
describe
'PATCH update'
do
let
(
:issue
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
])
}
let
!
(
:issue
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
])
}
context
'with valid params'
do
it
'returns a successful 200 response'
do
...
...
@@ -186,7 +200,7 @@ describe Projects::Boards::IssuesController do
end
it
'returns a not found 404 response for invalid issue id'
do
move
user:
user
,
board:
board
,
issue:
999
,
from_list_id:
list1
.
id
,
to_list_id:
list2
.
id
move
user:
user
,
board:
board
,
issue:
double
(
id:
999
)
,
from_list_id:
list1
.
id
,
to_list_id:
list2
.
id
expect
(
response
).
to
have_http_status
(
404
)
end
...
...
@@ -210,9 +224,9 @@ describe Projects::Boards::IssuesController do
sign_in
(
user
)
patch
:update
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
project_id:
project
.
id
,
board_id:
board
.
to_param
,
id:
issue
.
to_param
,
id:
issue
.
id
,
from_list_id:
from_list_id
,
to_list_id:
to_list_id
,
format: :json
...
...
spec/controllers/boards/lists_controller_spec.rb
View file @
02fed9a9
require
'spec_helper'
describe
Projects
::
Boards
::
ListsController
do
describe
Boards
::
ListsController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:board
)
{
create
(
:board
,
project:
project
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
spec/factories/milestones.rb
View file @
02fed9a9
...
...
@@ -7,6 +7,7 @@ FactoryGirl.define do
group
nil
project_id
nil
group_id
nil
parent
nil
end
trait
:active
do
...
...
@@ -26,6 +27,9 @@ FactoryGirl.define do
milestone
.
project
=
evaluator
.
project
elsif
evaluator
.
project_id
milestone
.
project_id
=
evaluator
.
project_id
elsif
evaluator
.
parent
id
=
evaluator
.
parent
.
id
evaluator
.
parent
.
is_a?
(
Group
)
?
board
.
group_id
=
id
:
evaluator
.
project_id
=
id
else
milestone
.
project
=
create
(
:project
)
end
...
...
spec/fixtures/api/schemas/issue.json
View file @
02fed9a9
...
...
@@ -8,10 +8,15 @@
"properties"
:
{
"id"
:
{
"type"
:
"integer"
},
"iid"
:
{
"type"
:
"integer"
},
"project_id"
:
{
"type"
:
[
"integer"
,
"null"
]
},
"title"
:
{
"type"
:
"string"
},
"confidential"
:
{
"type"
:
"boolean"
},
"due_date"
:
{
"type"
:
[
"date"
,
"null"
]
},
"relative_position"
:
{
"type"
:
"integer"
},
"project"
:
{
"id"
:
{
"type"
:
"integer"
},
"path"
:
{
"type"
:
"string"
}
},
"labels"
:
{
"type"
:
"array"
,
"items"
:
{
...
...
spec/services/boards/issues/create_service_spec.rb
View file @
02fed9a9
...
...
@@ -8,7 +8,7 @@ describe Boards::Issues::CreateService do
let
(
:label
)
{
create
(
:label
,
project:
project
,
name:
'in-progress'
)
}
let!
(
:list
)
{
create
(
:list
,
board:
board
,
label:
label
,
position:
0
)
}
subject
(
:service
)
{
described_class
.
new
(
project
,
user
,
board_id:
board
.
id
,
list_id:
list
.
id
,
title:
'New issue'
)
}
subject
(
:service
)
{
described_class
.
new
(
board
.
parent
,
project
,
user
,
board_id:
board
.
id
,
list_id:
list
.
id
,
title:
'New issue'
)
}
before
do
project
.
team
<<
[
user
,
: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