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
e3d32ff0
Commit
e3d32ff0
authored
Mar 16, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature specs for issue move
parent
5e3c9475
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
1 deletion
+78
-1
app/models/ability.rb
app/models/ability.rb
+1
-1
spec/features/issues/move_spec.rb
spec/features/issues/move_spec.rb
+77
-0
No files found.
app/models/ability.rb
View file @
e3d32ff0
...
...
@@ -222,7 +222,7 @@ class Ability
:admin_wiki
,
:admin_project
,
:admin_commit_status
,
:admin_build
,
:admin_build
]
end
...
...
spec/features/issues/move_spec.rb
0 → 100644
View file @
e3d32ff0
require
'rails_helper'
feature
'issue move to another project'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:old_project
)
{
create
(
:project
)
}
let
(
:text
)
{
'Some issue description'
}
let
(
:issue
)
do
create
(
:issue
,
description:
text
,
project:
old_project
,
author:
user
)
end
background
{
login_as
(
user
)
}
context
'user does not have permission to move issue'
do
background
do
old_project
.
team
<<
[
user
,
:guest
]
edit_issue
(
issue
)
end
scenario
'moving issue to another project not allowed'
do
expect
(
page
).
to
have_no_select
(
'move_to_project_id'
)
end
end
context
'user has permission to move issue'
do
let!
(
:mr
)
{
create
(
:merge_request
,
source_project:
old_project
)
}
let
(
:new_project
)
{
create
(
:project
)
}
let
(
:text
)
{
'Text with !1'
}
let
(
:cross_reference
)
{
old_project
.
to_reference
}
background
do
old_project
.
team
<<
[
user
,
:reporter
]
new_project
.
team
<<
[
user
,
:reporter
]
edit_issue
(
issue
)
end
scenario
'moving issue to another project'
,
js:
true
do
find
(
'#s2id_move_to_project_id'
).
click
find
(
'.select2-drop li'
,
text:
new_project
.
name_with_namespace
).
click
click_button
(
'Save changes'
)
expect
(
current_url
).
to
include
project_path
(
new_project
)
page
.
within
(
'.issue'
)
do
expect
(
page
).
to
have_content
(
"Text with
#{
cross_reference
}
!1"
)
expect
(
page
).
to
have_content
(
"Moved from
#{
cross_reference
}
#1"
)
expect
(
page
).
to
have_content
(
issue
.
title
)
end
end
context
'projects user does not have permission to move issue to exist'
do
let!
(
:private_project
)
{
create
(
:project
,
:private
)
}
let
(
:another_project
)
{
create
(
:project
)
}
background
{
another_project
.
team
<<
[
user
,
:guest
]
}
scenario
'browsing projects in projects select'
do
options
=
[
''
,
'No project'
,
new_project
.
name_with_namespace
]
expect
(
page
).
to
have_select
(
'move_to_project_id'
,
options:
options
)
end
end
end
def
edit_issue
(
issue
)
visit
issue_path
(
issue
)
page
.
within
(
'.issuable-header'
)
{
click_link
'Edit'
}
end
def
issue_path
(
issue
)
namespace_project_issue_path
(
issue
.
project
.
namespace
,
issue
.
project
,
issue
)
end
def
project_path
(
project
)
namespace_project_path
(
new_project
.
namespace
,
new_project
)
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