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
bebc526e
Commit
bebc526e
authored
Dec 19, 2018
by
Jasper Maes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated xhr from specs
parent
05b16421
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
27 deletions
+40
-27
changelogs/unreleased/fix-55448.yml
changelogs/unreleased/fix-55448.yml
+5
-0
spec/controllers/groups/group_members_controller_spec.rb
spec/controllers/groups/group_members_controller_spec.rb
+6
-4
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+2
-2
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+9
-7
spec/controllers/projects/project_members_controller_spec.rb
spec/controllers/projects/project_members_controller_spec.rb
+11
-7
spec/controllers/projects/refs_controller_spec.rb
spec/controllers/projects/refs_controller_spec.rb
+7
-7
No files found.
changelogs/unreleased/fix-55448.yml
0 → 100644
View file @
bebc526e
---
title
:
Remove deprecated xhr from specs
merge_request
:
23949
author
:
Jasper Maes
type
:
other
spec/controllers/groups/group_members_controller_spec.rb
View file @
bebc526e
...
@@ -78,9 +78,11 @@ describe Groups::GroupMembersController do
...
@@ -78,9 +78,11 @@ describe Groups::GroupMembersController do
Gitlab
::
Access
.
options
.
each
do
|
label
,
value
|
Gitlab
::
Access
.
options
.
each
do
|
label
,
value
|
it
"can change the access level to
#{
label
}
"
do
it
"can change the access level to
#{
label
}
"
do
xhr
:put
,
:update
,
group_member:
{
access_level:
value
},
put
:update
,
params:
{
group_id:
group
,
group_member:
{
access_level:
value
},
id:
requester
group_id:
group
,
id:
requester
},
xhr:
true
expect
(
requester
.
reload
.
human_access
).
to
eq
(
label
)
expect
(
requester
.
reload
.
human_access
).
to
eq
(
label
)
end
end
...
@@ -130,7 +132,7 @@ describe Groups::GroupMembersController do
...
@@ -130,7 +132,7 @@ describe Groups::GroupMembersController do
end
end
it
'[JS] removes user from members'
do
it
'[JS] removes user from members'
do
xhr
:delete
,
:destroy
,
group_id:
group
,
id:
member
delete
:destroy
,
params:
{
group_id:
group
,
id:
member
},
xhr:
true
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
expect
(
group
.
members
).
not_to
include
member
expect
(
group
.
members
).
not_to
include
member
...
...
spec/controllers/projects/issues_controller_spec.rb
View file @
bebc526e
...
@@ -206,12 +206,12 @@ describe Projects::IssuesController do
...
@@ -206,12 +206,12 @@ describe Projects::IssuesController do
describe
'Redirect after sign in'
do
describe
'Redirect after sign in'
do
context
'with an AJAX request'
do
context
'with an AJAX request'
do
it
'does not store the visited URL'
do
it
'does not store the visited URL'
do
xhr
:get
,
get
:show
,
params:
{
:show
,
format: :json
,
format: :json
,
namespace_id:
project
.
namespace
,
namespace_id:
project
.
namespace
,
project_id:
project
,
project_id:
project
,
id:
issue
.
iid
id:
issue
.
iid
},
xhr:
true
expect
(
session
[
'user_return_to'
]).
to
be_blank
expect
(
session
[
'user_return_to'
]).
to
be_blank
end
end
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
bebc526e
...
@@ -333,7 +333,7 @@ describe Projects::MergeRequestsController do
...
@@ -333,7 +333,7 @@ describe Projects::MergeRequestsController do
before
do
before
do
project
.
add_reporter
(
user
)
project
.
add_reporter
(
user
)
xhr
:post
,
:merge
,
params:
base_params
post
:merge
,
params:
base_params
,
xhr:
true
end
end
it
'returns 404'
do
it
'returns 404'
do
...
@@ -681,13 +681,14 @@ describe Projects::MergeRequestsController do
...
@@ -681,13 +681,14 @@ describe Projects::MergeRequestsController do
merge_request
.
title
=
merge_request
.
wip_title
merge_request
.
title
=
merge_request
.
wip_title
merge_request
.
save
merge_request
.
save
xhr
:post
,
:remove_wip
,
post
:remove_wip
,
format: :json
,
params:
{
params:
{
format: :json
,
namespace_id:
merge_request
.
project
.
namespace
.
to_param
,
namespace_id:
merge_request
.
project
.
namespace
.
to_param
,
project_id:
merge_request
.
project
,
project_id:
merge_request
.
project
,
id:
merge_request
.
iid
id:
merge_request
.
iid
}
},
xhr:
true
end
end
it
'removes the wip status'
do
it
'removes the wip status'
do
...
@@ -701,13 +702,14 @@ describe Projects::MergeRequestsController do
...
@@ -701,13 +702,14 @@ describe Projects::MergeRequestsController do
describe
'POST cancel_merge_when_pipeline_succeeds'
do
describe
'POST cancel_merge_when_pipeline_succeeds'
do
subject
do
subject
do
xhr
:post
,
:cancel_merge_when_pipeline_succeeds
,
post
:cancel_merge_when_pipeline_succeeds
,
format: :json
,
params:
{
params:
{
format: :json
,
namespace_id:
merge_request
.
project
.
namespace
.
to_param
,
namespace_id:
merge_request
.
project
.
namespace
.
to_param
,
project_id:
merge_request
.
project
,
project_id:
merge_request
.
project
,
id:
merge_request
.
iid
id:
merge_request
.
iid
}
},
xhr:
true
end
end
it
'calls MergeRequests::MergeWhenPipelineSucceedsService'
do
it
'calls MergeRequests::MergeWhenPipelineSucceedsService'
do
...
...
spec/controllers/projects/project_members_controller_spec.rb
View file @
bebc526e
...
@@ -82,10 +82,12 @@ describe Projects::ProjectMembersController do
...
@@ -82,10 +82,12 @@ describe Projects::ProjectMembersController do
Gitlab
::
Access
.
options
.
each
do
|
label
,
value
|
Gitlab
::
Access
.
options
.
each
do
|
label
,
value
|
it
"can change the access level to
#{
label
}
"
do
it
"can change the access level to
#{
label
}
"
do
xhr
:put
,
:update
,
project_member:
{
access_level:
value
},
put
:update
,
params:
{
namespace_id:
project
.
namespace
,
project_member:
{
access_level:
value
},
project_id:
project
,
namespace_id:
project
.
namespace
,
id:
requester
project_id:
project
,
id:
requester
},
xhr:
true
expect
(
requester
.
reload
.
human_access
).
to
eq
(
label
)
expect
(
requester
.
reload
.
human_access
).
to
eq
(
label
)
end
end
...
@@ -148,9 +150,11 @@ describe Projects::ProjectMembersController do
...
@@ -148,9 +150,11 @@ describe Projects::ProjectMembersController do
end
end
it
'[JS] removes user from members'
do
it
'[JS] removes user from members'
do
xhr
:delete
,
:destroy
,
namespace_id:
project
.
namespace
,
delete
:destroy
,
params:
{
project_id:
project
,
namespace_id:
project
.
namespace
,
id:
member
project_id:
project
,
id:
member
},
xhr:
true
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
expect
(
project
.
members
).
not_to
include
member
expect
(
project
.
members
).
not_to
include
member
...
...
spec/controllers/projects/refs_controller_spec.rb
View file @
bebc526e
...
@@ -22,13 +22,13 @@ describe Projects::RefsController do
...
@@ -22,13 +22,13 @@ describe Projects::RefsController do
end
end
def
xhr_get
(
format
=
:html
)
def
xhr_get
(
format
=
:html
)
xhr
:get
,
get
:logs_tree
,
params:
{
:logs_tree
,
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
project_id:
project
,
id:
'master'
,
id:
'master
'
,
path:
'foo/bar/baz.html
'
,
path:
'foo/bar/baz.html'
,
format:
format
format:
format
},
xhr:
true
end
end
it
'never throws MissingTemplate'
do
it
'never throws MissingTemplate'
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