BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
20 deletions
+19
-20
projects.rb
spec/factories/projects.rb
+18
-2
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