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
ca8d2253
Commit
ca8d2253
authored
Sep 01, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update MarkdownFeature support class
- Memoize variables a bit more cleanly - Add user to project's team
parent
86f706b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 deletions
+13
-19
spec/support/markdown_feature.rb
spec/support/markdown_feature.rb
+13
-19
No files found.
spec/support/markdown_feature.rb
View file @
ca8d2253
...
@@ -15,18 +15,17 @@ class MarkdownFeature
...
@@ -15,18 +15,17 @@ class MarkdownFeature
end
end
def
group
def
group
unless
@group
@group
||=
create
(
:group
).
tap
do
|
group
|
@group
=
create
(
:group
)
group
.
add_developer
(
user
)
@group
.
add_developer
(
user
)
end
end
@group
end
end
# Direct references ----------------------------------------------------------
# Direct references ----------------------------------------------------------
def
project
def
project
@project
||=
create
(
:project
)
@project
||=
create
(
:project
).
tap
do
|
project
|
project
.
team
<<
[
user
,
:master
]
end
end
end
def
issue
def
issue
...
@@ -46,12 +45,10 @@ class MarkdownFeature
...
@@ -46,12 +45,10 @@ class MarkdownFeature
end
end
def
commit_range
def
commit_range
unless
@commit_range
@commit_range
||=
begin
commit2
=
project
.
commit
(
'HEAD~3'
)
commit2
=
project
.
commit
(
'HEAD~3'
)
@commit_range
=
CommitRange
.
new
(
"
#{
commit
.
id
}
...
#{
commit2
.
id
}
"
,
project
)
CommitRange
.
new
(
"
#{
commit
.
id
}
...
#{
commit2
.
id
}
"
,
project
)
end
end
@commit_range
end
end
def
simple_label
def
simple_label
...
@@ -65,13 +62,12 @@ class MarkdownFeature
...
@@ -65,13 +62,12 @@ class MarkdownFeature
# Cross-references -----------------------------------------------------------
# Cross-references -----------------------------------------------------------
def
xproject
def
xproject
unless
@xproject
@xproject
||=
begin
namespace
=
create
(
:namespace
,
name:
'cross-reference'
)
namespace
=
create
(
:namespace
,
name:
'cross-reference'
)
@xproject
=
create
(
:project
,
namespace:
namespace
)
create
(
:project
,
namespace:
namespace
)
do
|
project
|
@xproject
.
team
<<
[
user
,
:developer
]
project
.
team
<<
[
user
,
:developer
]
end
end
end
@xproject
end
end
def
xissue
def
xissue
...
@@ -91,12 +87,10 @@ class MarkdownFeature
...
@@ -91,12 +87,10 @@ class MarkdownFeature
end
end
def
xcommit_range
def
xcommit_range
unless
@xcommit_range
@xcommit_range
||=
begin
xcommit2
=
xproject
.
commit
(
'HEAD~2'
)
xcommit2
=
xproject
.
commit
(
'HEAD~2'
)
@xcommit_range
=
CommitRange
.
new
(
"
#{
xcommit
.
id
}
...
#{
xcommit2
.
id
}
"
,
xproject
)
CommitRange
.
new
(
"
#{
xcommit
.
id
}
...
#{
xcommit2
.
id
}
"
,
xproject
)
end
end
@xcommit_range
end
end
def
raw_markdown
def
raw_markdown
...
...
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