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
7f778b7a
Commit
7f778b7a
authored
7 years ago
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy up projects API specs
parent
e8f29569
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
40 deletions
+23
-40
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+23
-15
spec/requests/api/v3/projects_spec.rb
spec/requests/api/v3/projects_spec.rb
+0
-25
No files found.
spec/requests/api/projects_spec.rb
View file @
7f778b7a
...
@@ -479,31 +479,39 @@ describe API::Projects do
...
@@ -479,31 +479,39 @@ describe API::Projects do
end
end
it
'sets a project as allowing outdated diff discussions to automatically resolve'
do
it
'sets a project as allowing outdated diff discussions to automatically resolve'
do
project
=
attributes_for
(
:project
,
{
resolve_outdated_diff_discussions:
false
})
project
=
attributes_for
(
:project
,
resolve_outdated_diff_discussions:
false
)
post
api
(
'/projects'
,
user
),
project
post
api
(
'/projects'
,
user
),
project
expect
(
json_response
[
'resolve_outdated_diff_discussions'
]).
to
be_falsey
expect
(
json_response
[
'resolve_outdated_diff_discussions'
]).
to
be_falsey
end
end
it
'sets a project as allowing outdated diff discussions to automatically resolve if resolve_outdated_diff_discussions'
do
it
'sets a project as allowing outdated diff discussions to automatically resolve if resolve_outdated_diff_discussions'
do
project
=
attributes_for
(
:project
,
{
resolve_outdated_diff_discussions:
true
})
project
=
attributes_for
(
:project
,
resolve_outdated_diff_discussions:
true
)
post
api
(
'/projects'
,
user
),
project
post
api
(
'/projects'
,
user
),
project
expect
(
json_response
[
'resolve_outdated_diff_discussions'
]).
to
be_truthy
expect
(
json_response
[
'resolve_outdated_diff_discussions'
]).
to
be_truthy
end
end
it
'sets a project as allowing merge even if build fails'
do
it
'sets a project as allowing merge even if build fails'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_pipeline_succeeds:
false
})
project
=
attributes_for
(
:project
,
only_allow_merge_if_pipeline_succeeds:
false
)
post
api
(
'/projects'
,
user
),
project
post
api
(
'/projects'
,
user
),
project
expect
(
json_response
[
'only_allow_merge_if_pipeline_succeeds'
]).
to
be_falsey
expect
(
json_response
[
'only_allow_merge_if_pipeline_succeeds'
]).
to
be_falsey
end
end
it
'sets a project as allowing merge only if merge_when_pipeline_succeeds'
do
it
'sets a project as allowing merge only if merge_when_pipeline_succeeds'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_pipeline_succeeds:
true
})
project
=
attributes_for
(
:project
,
only_allow_merge_if_pipeline_succeeds:
true
)
post
api
(
'/projects'
,
user
),
project
post
api
(
'/projects'
,
user
),
project
expect
(
json_response
[
'only_allow_merge_if_pipeline_succeeds'
]).
to
be_truthy
expect
(
json_response
[
'only_allow_merge_if_pipeline_succeeds'
]).
to
be_truthy
end
end
it
'sets a project as allowing merge even if discussions are unresolved'
do
it
'sets a project as allowing merge even if discussions are unresolved'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_all_discussions_are_resolved:
false
}
)
project
=
attributes_for
(
:project
,
only_allow_merge_if_all_discussions_are_resolved:
false
)
post
api
(
'/projects'
,
user
),
project
post
api
(
'/projects'
,
user
),
project
...
@@ -519,7 +527,7 @@ describe API::Projects do
...
@@ -519,7 +527,7 @@ describe API::Projects do
end
end
it
'sets a project as allowing merge only if all discussions are resolved'
do
it
'sets a project as allowing merge only if all discussions are resolved'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_all_discussions_are_resolved:
true
}
)
project
=
attributes_for
(
:project
,
only_allow_merge_if_all_discussions_are_resolved:
true
)
post
api
(
'/projects'
,
user
),
project
post
api
(
'/projects'
,
user
),
project
...
@@ -527,7 +535,7 @@ describe API::Projects do
...
@@ -527,7 +535,7 @@ describe API::Projects do
end
end
it
'ignores import_url when it is nil'
do
it
'ignores import_url when it is nil'
do
project
=
attributes_for
(
:project
,
{
import_url:
nil
}
)
project
=
attributes_for
(
:project
,
import_url:
nil
)
post
api
(
'/projects'
,
user
),
project
post
api
(
'/projects'
,
user
),
project
...
@@ -656,15 +664,15 @@ describe API::Projects do
...
@@ -656,15 +664,15 @@ describe API::Projects do
end
end
it
'sets a project as allowing outdated diff discussions to automatically resolve'
do
it
'sets a project as allowing outdated diff discussions to automatically resolve'
do
project
=
attributes_for
(
:project
,
{
resolve_outdated_diff_discussions:
false
}
)
project
=
attributes_for
(
:project
,
resolve_outdated_diff_discussions:
false
)
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
expect
(
json_response
[
'resolve_outdated_diff_discussions'
]).
to
be_falsey
expect
(
json_response
[
'resolve_outdated_diff_discussions'
]).
to
be_falsey
end
end
it
'sets a project as allowing outdated diff discussions to automatically resolve
only if resolve_outdated_diff_discussions
'
do
it
'sets a project as allowing outdated diff discussions to automatically resolve'
do
project
=
attributes_for
(
:project
,
{
resolve_outdated_diff_discussions:
true
}
)
project
=
attributes_for
(
:project
,
resolve_outdated_diff_discussions:
true
)
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
...
@@ -672,19 +680,19 @@ describe API::Projects do
...
@@ -672,19 +680,19 @@ describe API::Projects do
end
end
it
'sets a project as allowing merge even if build fails'
do
it
'sets a project as allowing merge even if build fails'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_pipeline_succeeds:
false
}
)
project
=
attributes_for
(
:project
,
only_allow_merge_if_pipeline_succeeds:
false
)
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
expect
(
json_response
[
'only_allow_merge_if_pipeline_succeeds'
]).
to
be_falsey
expect
(
json_response
[
'only_allow_merge_if_pipeline_succeeds'
]).
to
be_falsey
end
end
it
'sets a project as allowing merge only if
merge_when_pipeline_
succeeds'
do
it
'sets a project as allowing merge only if
pipeline
succeeds'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_pipeline_succeeds:
true
}
)
project
=
attributes_for
(
:project
,
only_allow_merge_if_pipeline_succeeds:
true
)
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
expect
(
json_response
[
'only_allow_merge_if_pipeline_succeeds'
]).
to
be_truthy
expect
(
json_response
[
'only_allow_merge_if_pipeline_succeeds'
]).
to
be_truthy
end
end
it
'sets a project as allowing merge even if discussions are unresolved'
do
it
'sets a project as allowing merge even if discussions are unresolved'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_all_discussions_are_resolved:
false
}
)
project
=
attributes_for
(
:project
,
only_allow_merge_if_all_discussions_are_resolved:
false
)
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
...
@@ -692,7 +700,7 @@ describe API::Projects do
...
@@ -692,7 +700,7 @@ describe API::Projects do
end
end
it
'sets a project as allowing merge only if all discussions are resolved'
do
it
'sets a project as allowing merge only if all discussions are resolved'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_all_discussions_are_resolved:
true
}
)
project
=
attributes_for
(
:project
,
only_allow_merge_if_all_discussions_are_resolved:
true
)
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
post
api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
...
...
This diff is collapsed.
Click to expand it.
spec/requests/api/v3/projects_spec.rb
View file @
7f778b7a
...
@@ -394,7 +394,6 @@ describe API::V3::Projects do
...
@@ -394,7 +394,6 @@ describe API::V3::Projects do
issues_enabled:
false
,
issues_enabled:
false
,
merge_requests_enabled:
false
,
merge_requests_enabled:
false
,
wiki_enabled:
false
,
wiki_enabled:
false
,
resolve_outdated_diff_discussions:
false
,
only_allow_merge_if_build_succeeds:
false
,
only_allow_merge_if_build_succeeds:
false
,
request_access_enabled:
true
,
request_access_enabled:
true
,
only_allow_merge_if_all_discussions_are_resolved:
false
only_allow_merge_if_all_discussions_are_resolved:
false
...
@@ -456,18 +455,6 @@ describe API::V3::Projects do
...
@@ -456,18 +455,6 @@ describe API::V3::Projects do
expect
(
json_response
[
'visibility_level'
]).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
expect
(
json_response
[
'visibility_level'
]).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
end
it
'sets a project as allowing outdated diff discussions to automatically resolve'
do
project
=
attributes_for
(
:project
,
{
resolve_outdated_diff_discussions:
false
})
post
v3_api
(
'/projects'
,
user
),
project
expect
(
json_response
[
'resolve_outdated_diff_discussions'
]).
to
be_falsey
end
it
'sets a project as allowing outdated diff discussions to automatically resolve if resolve_outdated_diff_discussions'
do
project
=
attributes_for
(
:project
,
{
resolve_outdated_diff_discussions:
true
})
post
v3_api
(
'/projects'
,
user
),
project
expect
(
json_response
[
'resolve_outdated_diff_discussions'
]).
to
be_truthy
end
it
'sets a project as allowing merge even if build fails'
do
it
'sets a project as allowing merge even if build fails'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_build_succeeds:
false
})
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_build_succeeds:
false
})
post
v3_api
(
'/projects'
,
user
),
project
post
v3_api
(
'/projects'
,
user
),
project
...
@@ -612,18 +599,6 @@ describe API::V3::Projects do
...
@@ -612,18 +599,6 @@ describe API::V3::Projects do
expect
(
json_response
[
'visibility_level'
]).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
expect
(
json_response
[
'visibility_level'
]).
to
eq
(
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
end
it
'sets a project as allowing outdated diff discussions to automatically resolve'
do
project
=
attributes_for
(
:project
,
{
resolve_outdated_diff_discussions:
false
})
post
v3_api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
expect
(
json_response
[
'resolve_outdated_diff_discussions'
]).
to
be_falsey
end
it
'sets a project as allowing outdated diff discussions to automatically resolve only if resolve_outdated_diff_discussions'
do
project
=
attributes_for
(
:project
,
{
resolve_outdated_diff_discussions:
true
})
post
v3_api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
expect
(
json_response
[
'resolve_outdated_diff_discussions'
]).
to
be_truthy
end
it
'sets a project as allowing merge even if build fails'
do
it
'sets a project as allowing merge even if build fails'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_build_succeeds:
false
})
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_build_succeeds:
false
})
post
v3_api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
post
v3_api
(
"/projects/user/
#{
user
.
id
}
"
,
admin
),
project
...
...
This diff is collapsed.
Click to expand it.
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