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
Léo-Paul Géneau
gitlab-ce
Commits
53719ecb
Commit
53719ecb
authored
Mar 09, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle permissions for ExternalIssue instances
This fixes the remainder of the GitPushService specs.
parent
96d35c59
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
app/models/ability.rb
app/models/ability.rb
+5
-0
spec/services/git_push_service_spec.rb
spec/services/git_push_service_spec.rb
+2
-2
No files found.
app/models/ability.rb
View file @
53719ecb
...
@@ -9,6 +9,7 @@ class Ability
...
@@ -9,6 +9,7 @@ class Ability
when
CommitStatus
then
commit_status_abilities
(
user
,
subject
)
when
CommitStatus
then
commit_status_abilities
(
user
,
subject
)
when
Project
then
project_abilities
(
user
,
subject
)
when
Project
then
project_abilities
(
user
,
subject
)
when
Issue
then
issue_abilities
(
user
,
subject
)
when
Issue
then
issue_abilities
(
user
,
subject
)
when
ExternalIssue
then
external_issue_abilities
(
user
,
subject
)
when
Note
then
note_abilities
(
user
,
subject
)
when
Note
then
note_abilities
(
user
,
subject
)
when
ProjectSnippet
then
project_snippet_abilities
(
user
,
subject
)
when
ProjectSnippet
then
project_snippet_abilities
(
user
,
subject
)
when
PersonalSnippet
then
personal_snippet_abilities
(
user
,
subject
)
when
PersonalSnippet
then
personal_snippet_abilities
(
user
,
subject
)
...
@@ -424,6 +425,10 @@ class Ability
...
@@ -424,6 +425,10 @@ class Ability
end
end
end
end
def
external_issue_abilities
(
user
,
subject
)
project_abilities
(
user
,
subject
.
project
)
end
private
private
def
named_abilities
(
name
)
def
named_abilities
(
name
)
...
...
spec/services/git_push_service_spec.rb
View file @
53719ecb
...
@@ -367,7 +367,7 @@ describe GitPushService, services: true do
...
@@ -367,7 +367,7 @@ describe GitPushService, services: true do
}
}
}.
to_json
}.
to_json
execute_service
(
project
,
use
r
,
@oldrev
,
@newrev
,
@ref
)
execute_service
(
project
,
commit_autho
r
,
@oldrev
,
@newrev
,
@ref
)
expect
(
WebMock
).
to
have_requested
(
:post
,
jira_api_transition_url
).
with
(
expect
(
WebMock
).
to
have_requested
(
:post
,
jira_api_transition_url
).
with
(
body:
transition_body
body:
transition_body
).
once
).
once
...
@@ -378,7 +378,7 @@ describe GitPushService, services: true do
...
@@ -378,7 +378,7 @@ describe GitPushService, services: true do
body:
"Issue solved with [
#{
closing_commit
.
id
}
|http://localhost/
#{
project
.
path_with_namespace
}
/commit/
#{
closing_commit
.
id
}
]."
body:
"Issue solved with [
#{
closing_commit
.
id
}
|http://localhost/
#{
project
.
path_with_namespace
}
/commit/
#{
closing_commit
.
id
}
]."
}.
to_json
}.
to_json
execute_service
(
project
,
use
r
,
@oldrev
,
@newrev
,
@ref
)
execute_service
(
project
,
commit_autho
r
,
@oldrev
,
@newrev
,
@ref
)
expect
(
WebMock
).
to
have_requested
(
:post
,
jira_api_comment_url
).
with
(
expect
(
WebMock
).
to
have_requested
(
:post
,
jira_api_comment_url
).
with
(
body:
comment_body
body:
comment_body
).
once
).
once
...
...
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