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
Boxiang Sun
gitlab-ce
Commits
551ce0f2
Commit
551ce0f2
authored
Feb 05, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for assigning view param from cookie
parent
24f048be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+19
-5
No files found.
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
551ce0f2
...
@@ -200,15 +200,29 @@ describe Projects::MergeRequestsController do
...
@@ -200,15 +200,29 @@ describe Projects::MergeRequestsController do
end
end
describe
'GET diffs with view'
do
describe
'GET diffs with view'
do
it
'saves the preferred diff view in a cookie'
do
def
go
(
extra_params
=
{})
get
:diffs
,
params
=
{
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
id:
merge_request
.
iid
,
id:
merge_request
.
iid
view:
'parallel'
}
get
:diffs
,
params
.
merge
(
extra_params
)
end
it
'saves the preferred diff view in a cookie'
do
go
view:
'parallel'
expect
(
response
.
cookies
[
'diff_view'
]).
to
eq
(
'parallel'
)
expect
(
response
.
cookies
[
'diff_view'
]).
to
eq
(
'parallel'
)
end
end
it
'assigns :view param based on cookie'
do
request
.
cookies
[
'diff_view'
]
=
'parallel'
go
expect
(
controller
.
params
[
:view
]).
to
eq
'parallel'
end
end
end
describe
'GET commits'
do
describe
'GET commits'
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