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
4155df1c
Commit
4155df1c
authored
May 02, 2018
by
blackst0ne
Committed by
Rémy Coutable
May 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the `project/source/markdown_render.feature` spinach test with an rspec analog
parent
8d74af10
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
337 additions
and
661 deletions
+337
-661
changelogs/unreleased/blackst0ne-replace-spinach-project-source-markdown-render-feature.yml
...eplace-spinach-project-source-markdown-render-feature.yml
+5
-0
features/project/source/markdown_render.feature
features/project/source/markdown_render.feature
+0
-147
features/steps/project/source/markdown_render.rb
features/steps/project/source/markdown_render.rb
+0
-317
features/steps/shared/markdown.rb
features/steps/shared/markdown.rb
+0
-9
spec/features/projects/files/user_browses_files_spec.rb
spec/features/projects/files/user_browses_files_spec.rb
+168
-72
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+164
-116
No files found.
changelogs/unreleased/blackst0ne-replace-spinach-project-source-markdown-render-feature.yml
0 → 100644
View file @
4155df1c
---
title
:
Replace the `project/source/markdown_render.feature` spinach test with an rspec analog
merge_request
:
18525
author
:
"
@blackst0ne"
type
:
other
features/project/source/markdown_render.feature
deleted
100644 → 0
View file @
8d74af10
Feature
:
Project Source Markdown Render
Background
:
Given
I sign in as a user
And
I own project
"Delta"
And
I visit markdown branch
# Tree README
@javascript
Scenario
:
Tree view should have correct links in README
Given
I go directory which contains README file
And
I click on a relative link in README
Then
I should see the correct markdown
@javascript
Scenario
:
I
browse files from markdown branch
Then
I should see files from repository in markdown
And
I should see rendered README which contains correct links
And
I click on Gitlab API in README
Then
I should see correct document rendered
@javascript
Scenario
:
I
view README in markdown branch
Then
I should see files from repository in markdown
And
I should see rendered README which contains correct links
And
I click on Rake tasks in README
Then
I should see correct directory rendered
@javascript
Scenario
:
I
view README in markdown branch to see reference links to directory
Then
I should see files from repository in markdown
And
I should see rendered README which contains correct links
And
I click on GitLab API doc directory in README
Then
I should see correct doc/api directory rendered
@javascript
Scenario
:
I
view README in markdown branch to see reference links to file
Then
I should see files from repository in markdown
And
I should see rendered README which contains correct links
And
I click on Maintenance in README
Then
I should see correct maintenance file rendered
@javascript
Scenario
:
README headers should have header links
Then
I should see rendered README which contains correct links
And
Header
"Application details"
should have correct id and link
# Blob
@javascript
Scenario
:
I
navigate to doc directory to view documentation in markdown
And
I navigate to the doc/api/README
And
I see correct file rendered
And
I click on users in doc/api/README
Then
I should see the correct document file
@javascript
Scenario
:
I
navigate to doc directory to view user doc in markdown
And
I navigate to the doc/api/README
And
I see correct file rendered
And
I click on raketasks in doc/api/README
Then
I should see correct directory rendered
@javascript
Scenario
:
I
navigate to doc directory to view user doc in markdown
And
I navigate to the doc/api/README
And
Header
"GitLab API"
should have correct id and link
# Markdown branch
@javascript
Scenario
:
I
browse files from markdown branch
When
I visit markdown branch
Then
I should see files from repository in markdown branch
And
I should see rendered README which contains correct links
And
I click on Gitlab API in README
Then
I should see correct document rendered for markdown branch
@javascript
Scenario
:
I
browse directory from markdown branch
When
I visit markdown branch
Then
I should see files from repository in markdown branch
And
I should see rendered README which contains correct links
And
I click on Rake tasks in README
Then
I should see correct directory rendered for markdown branch
@javascript
Scenario
:
I
navigate to doc directory to view documentation in markdown branch
When
I visit markdown branch
And
I navigate to the doc/api/README
And
I see correct file rendered in markdown branch
And
I click on users in doc/api/README
Then
I should see the users document file in markdown branch
@javascript
Scenario
:
I
navigate to doc directory to view user doc in markdown branch
When
I visit markdown branch
And
I navigate to the doc/api/README
And
I see correct file rendered in markdown branch
And
I click on raketasks in doc/api/README
Then
I should see correct directory rendered for markdown branch
@javascript
Scenario
:
Tree markdown links view empty urls should have correct urls
When
I visit markdown branch
Then
The link with text
"empty"
should have url
"tree/markdown"
When
I visit markdown branch
"README.md"
blob
Then
The link with text
"empty"
should have url
"blob/markdown/README.md"
When
I visit markdown branch
"d"
tree
Then
The link with text
"empty"
should have url
"tree/markdown/d"
When
I visit markdown branch
"d/README.md"
blob
Then
The link with text
"empty"
should have url
"blob/markdown/d/README.md"
# "ID" means "#id" on the tests below, because we are unable to escape the hash sign.
# which Spinach interprets as the start of a comment.
@javascript
Scenario
:
All markdown links with ids should have correct urls
When
I visit markdown branch
Then
The link with text
"ID"
should have url
"tree/markdownID"
Then
The link with text
"/ID"
should have url
"tree/markdownID"
Then
The link with text
"README.mdID"
should have url
"blob/markdown/README.mdID"
Then
The link with text
"d/README.mdID"
should have url
"blob/markdown/d/README.mdID"
When
I visit markdown branch
"README.md"
blob
Then
The link with text
"ID"
should have url
"blob/markdown/README.mdID"
Then
The link with text
"/ID"
should have url
"blob/markdown/README.mdID"
Then
The link with text
"README.mdID"
should have url
"blob/markdown/README.mdID"
Then
The link with text
"d/README.mdID"
should have url
"blob/markdown/d/README.mdID"
# Wiki
Scenario
:
I
create a wiki page with different links
Given
I go to wiki page
And
I add various links to the wiki page
Then
Wiki page should have added links
And
I click on test link
Then
I see new wiki page named test
When
I go back to wiki page home
And
I click on GitLab API doc link
Then
I see Gitlab API document
When
I go back to wiki page home
And
I click on Rake tasks link
Then
I see Rake tasks directory
Scenario
:
Wiki headers should have should have ids generated for them.
Given
I go to wiki page
And
I add a header to the wiki page
Then
Wiki header should have correct id and link
features/steps/project/source/markdown_render.rb
deleted
100644 → 0
View file @
8d74af10
This diff is collapsed.
Click to expand it.
features/steps/shared/markdown.rb
View file @
4155df1c
module
SharedMarkdown
include
Spinach
::
DSL
def
header_should_have_correct_id_and_link
(
level
,
text
,
id
,
parent
=
".wiki"
)
node
=
find
(
"
#{
parent
}
h
#{
level
}
a#user-content-
#{
id
}
"
)
expect
(
node
[
:href
]).
to
end_with
"#
#{
id
}
"
# Work around a weird Capybara behavior where calling `parent` on a node
# returns the whole document, not the node's actual parent element
expect
(
find
(
:xpath
,
"
#{
node
.
path
}
/.."
).
text
).
to
eq
text
end
step
'I should not see the Markdown preview'
do
expect
(
find
(
'.gfm-form .js-md-preview'
)).
not_to
be_visible
end
...
...
spec/features/projects/files/user_browses_files_spec.rb
View file @
4155df1c
This diff is collapsed.
Click to expand it.
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
View file @
4155df1c
This diff is collapsed.
Click to expand it.
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