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
49ded5c1
Commit
49ded5c1
authored
May 19, 2017
by
Ruben Davila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix: don't redirect to JSON endpoints after sign in
parent
bdf62a19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+4
-1
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+26
-0
No files found.
app/controllers/projects/issues_controller.rb
View file @
49ded5c1
...
@@ -277,7 +277,10 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -277,7 +277,10 @@ class Projects::IssuesController < Projects::ApplicationController
notice
=
"Please sign in to create the new issue."
notice
=
"Please sign in to create the new issue."
store_location_for
:user
,
request
.
fullpath
if
request
.
get?
&&
!
request
.
xhr?
store_location_for
:user
,
request
.
fullpath
end
redirect_to
new_user_session_path
,
notice:
notice
redirect_to
new_user_session_path
,
notice:
notice
end
end
end
end
spec/controllers/projects/issues_controller_spec.rb
View file @
49ded5c1
...
@@ -156,6 +156,32 @@ describe Projects::IssuesController do
...
@@ -156,6 +156,32 @@ describe Projects::IssuesController do
end
end
end
end
describe
'Redirect after sign in'
do
context
'with an AJAX request'
do
it
'does not store the visited URL'
do
xhr
:get
,
:show
,
format: :json
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
issue
.
iid
expect
(
session
[
'user_return_to'
]).
to
be_blank
end
end
context
'without an AJAX request'
do
it
'stores the visited URL'
do
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
id:
issue
.
iid
expect
(
session
[
'user_return_to'
]).
to
eq
(
"/
#{
project
.
namespace
.
to_param
}
/
#{
project
.
to_param
}
/issues/
#{
issue
.
iid
}
"
)
end
end
end
describe
'PUT #update'
do
describe
'PUT #update'
do
before
do
before
do
sign_in
(
user
)
sign_in
(
user
)
...
...
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