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
5a949e60
Commit
5a949e60
authored
May 05, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for wiki files showing.
parent
4146e885
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
features/project/wiki.feature
features/project/wiki.feature
+17
-0
features/steps/project/wiki.rb
features/steps/project/wiki.rb
+38
-0
No files found.
features/project/wiki.feature
View file @
5a949e60
...
...
@@ -45,3 +45,20 @@ Feature: Project Wiki
And
I browse to that Wiki page
And
I click on the
"Pages"
button
Then
I should see the existing page in the pages list
Scenario
:
Image in wiki repo shown on the page
Given
I have an existing Wiki page with images linked on page
And
I browse to wiki page with images
Then
Image should be shown on the page
Scenario
:
File does not exist in wiki repo
Given
I have an existing Wiki page with images linked on page
And
I browse to wiki page with images
And
I click on image link
Then
I should see the new wiki page form
Scenario
:
File exists in wiki repo
Given
I have an existing Wiki page with images linked on page
And
I browse to wiki page with images
And
I click on existing image link
Then
I should see the image from wiki repo
features/steps/project/wiki.rb
View file @
5a949e60
...
...
@@ -86,6 +86,44 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
page
.
should
have_content
@page
.
title
end
Given
'I have an existing Wiki page with images linked on page'
do
wiki
.
create_page
(
"pictures"
,
"Look at this [image](image.jpg)
\n\n
![image](image.jpg)"
,
:markdown
,
"first commit"
)
@wiki_page
=
wiki
.
find_page
(
"pictures"
)
end
And
'I browse to wiki page with images'
do
visit
project_wiki_path
(
project
,
@wiki_page
)
end
And
'I click on existing image link'
do
Gollum
::
Wiki
.
any_instance
.
should_receive
(
:file
).
with
(
"image.jpg"
,
"master"
,
true
).
and_return
(
Gollum
::
File
.
new
(
wiki
.
wiki
))
Gollum
::
File
.
any_instance
.
should_receive
(
:mime_type
).
and_return
(
"image/jpeg"
)
page
.
should
have_link
(
'image'
,
href:
"image.jpg"
)
click_on
"image"
end
Then
'I should see the image from wiki repo'
do
url
=
URI
.
parse
(
current_url
)
url
.
path
.
should
match
(
"wikis/image.jpg"
)
page
.
should_not
have_xpath
(
'/html'
)
# Page should render the image which means there is no html involved
end
Then
'Image should be shown on the page'
do
page
.
should
have_xpath
(
"//img[@src=
\"
image.jpg
\"
]"
)
end
And
'I click on image link'
do
page
.
should
have_link
(
'image'
,
href:
"image.jpg"
)
click_on
"image"
end
Then
'I should see the new wiki page form'
do
url
=
URI
.
parse
(
current_url
)
url
.
path
.
should
match
(
"wikis/image.jpg"
)
page
.
should
have_content
(
'New Wiki Page'
)
page
.
should
have_content
(
'Editing - image.jpg'
)
end
def
wiki
@project_wiki
=
ProjectWiki
.
new
(
project
,
current_user
)
end
...
...
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