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
iv
gitlab-ce
Commits
f4fac3ac
Commit
f4fac3ac
authored
Apr 29, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add jira_project project factory
parent
50f707e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
20 deletions
+19
-20
spec/factories/projects.rb
spec/factories/projects.rb
+18
-2
spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
...b/gitlab/markdown/external_issue_reference_filter_spec.rb
+1
-18
No files found.
spec/factories/projects.rb
View file @
f4fac3ac
...
...
@@ -94,10 +94,26 @@ FactoryGirl.define do
'new_issue_url'
=>
'http://redmine/projects/project_name_in_redmine/issues/new'
}
)
end
after
:create
do
|
project
|
project
.
issues_tracker
=
'redmine'
project
.
issues_tracker_id
=
'project_name_in_redmine'
end
end
factory
:jira_project
,
parent: :project
do
after
:create
do
|
project
|
project
.
create_jira_service
(
active:
true
,
properties:
{
'title'
=>
'JIRA tracker'
,
'project_url'
=>
'http://jira.example/issues/?jql=project=A'
,
'issues_url'
=>
'http://jira.example/browse/:id'
,
'new_issue_url'
=>
'http://jira.example/secure/CreateIssue.jspa'
}
)
project
.
issues_tracker
=
'jira'
project
.
issues_tracker_id
=
'project_name_in_jira'
end
end
end
spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
View file @
f4fac3ac
...
...
@@ -8,29 +8,12 @@ module Gitlab::Markdown
IssuesHelper
end
let
(
:project
)
{
create
(
:
empty
_project
)
}
let
(
:project
)
{
create
(
:
jira
_project
)
}
let
(
:issue
)
{
double
(
'issue'
,
iid:
123
)
}
context
'JIRA issue references'
do
let
(
:reference
)
{
"JIRA-
#{
issue
.
iid
}
"
}
before
do
jira
=
project
.
create_jira_service
props
=
{
'title'
=>
'JIRA tracker'
,
'project_url'
=>
'http://jira.example/issues/?jql=project=A'
,
'issues_url'
=>
'http://jira.example/browse/:id'
,
'new_issue_url'
=>
'http://jira.example/secure/CreateIssue.jspa'
}
jira
.
update_attributes
(
properties:
props
,
active:
true
)
end
after
do
project
.
jira_service
.
destroy
end
it
'requires project context'
do
expect
{
described_class
.
call
(
'Issue JIRA-123'
,
{})
}.
to
raise_error
(
ArgumentError
,
/:project/
)
...
...
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