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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
edd04207
Commit
edd04207
authored
Sep 16, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
273c8f63
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
config/routes/project.rb
config/routes/project.rb
+2
-1
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+34
-0
No files found.
config/routes/project.rb
View file @
edd04207
...
@@ -239,8 +239,9 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
...
@@ -239,8 +239,9 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
end
end
resources
:merge_requests
,
concerns: :awardable
,
except:
[
:new
,
:create
],
constraints:
{
id:
/\d+/
}
do
resources
:merge_requests
,
concerns: :awardable
,
except:
[
:new
,
:create
,
:show
],
constraints:
{
id:
/\d+/
}
do
member
do
member
do
get
:show
# Insert this first to ensure redirections using merge_requests#show match this route
get
:commit_change_content
get
:commit_change_content
post
:merge
post
:merge
post
:cancel_auto_merge
post
:cancel_auto_merge
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
edd04207
...
@@ -78,6 +78,40 @@ describe Projects::MergeRequestsController do
...
@@ -78,6 +78,40 @@ describe Projects::MergeRequestsController do
expect
(
response
).
to
be_successful
expect
(
response
).
to
be_successful
end
end
end
end
context
'when project has moved'
do
let
(
:new_project
)
{
create
(
:project
)
}
before
do
project
.
route
.
destroy
new_project
.
redirect_routes
.
create!
(
path:
project
.
full_path
)
new_project
.
add_developer
(
user
)
end
it
'redirects from an old merge request correctly'
do
get
:show
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
merge_request
}
expect
(
response
).
to
redirect_to
(
project_merge_request_path
(
new_project
,
merge_request
))
expect
(
response
).
to
have_gitlab_http_status
(
302
)
end
it
'redirects from an old merge request commits correctly'
do
get
:commits
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
merge_request
}
expect
(
response
).
to
redirect_to
(
commits_project_merge_request_path
(
new_project
,
merge_request
))
expect
(
response
).
to
have_gitlab_http_status
(
302
)
end
end
end
end
context
'when user is setting notes filters'
do
context
'when user is setting notes filters'
do
...
...
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