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
Boxiang Sun
gitlab-ce
Commits
0cfb3819
Commit
0cfb3819
authored
Apr 20, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix feature specs
parent
a6536a84
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
2 deletions
+28
-2
features/project/source/browse_files.feature
features/project/source/browse_files.feature
+2
-1
features/project/source/markdown_render.feature
features/project/source/markdown_render.feature
+12
-0
features/steps/project/source/browse_files.rb
features/steps/project/source/browse_files.rb
+3
-0
features/steps/project/source/markdown_render.rb
features/steps/project/source/markdown_render.rb
+10
-0
features/steps/shared/markdown.rb
features/steps/shared/markdown.rb
+1
-1
No files found.
features/project/source/browse_files.feature
View file @
0cfb3819
...
...
@@ -11,6 +11,7 @@ Feature: Project Source Browse Files
Given
I visit project source page for
"6d39438"
Then
I should see files from repository for
"6d39438"
@javascript
Scenario
:
I
browse file content
Given
I click on
".gitignore"
file in repo
Then
I should see its content
...
...
features/project/source/markdown_render.feature
View file @
0cfb3819
...
...
@@ -6,11 +6,13 @@ Feature: Project Source Markdown Render
# 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
...
...
@@ -29,36 +31,42 @@ Feature: Project Source Markdown Render
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
...
...
@@ -73,6 +81,7 @@ Feature: Project Source Markdown Render
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
...
...
@@ -80,6 +89,7 @@ Feature: Project Source Markdown Render
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
...
...
@@ -87,6 +97,7 @@ Feature: Project Source Markdown Render
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"
...
...
@@ -99,6 +110,7 @@ Feature: Project Source Markdown Render
# "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"
...
...
features/steps/project/source/browse_files.rb
View file @
0cfb3819
...
...
@@ -4,6 +4,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
include
SharedProject
include
SharedPaths
include
RepoHelpers
include
WaitForAjax
step
"I don't have write access"
do
@project
=
create
(
:project
,
:repository
,
name:
"Other Project"
,
path:
"other-project"
)
...
...
@@ -36,10 +37,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step
'I should see its content'
do
wait_for_ajax
expect
(
page
).
to
have_content
old_gitignore_content
end
step
'I should see its new content'
do
wait_for_ajax
expect
(
page
).
to
have_content
new_gitignore_content
end
...
...
features/steps/project/source/markdown_render.rb
View file @
0cfb3819
...
...
@@ -5,6 +5,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedMarkdown
include
WaitForAjax
step
'I own project "Delta"'
do
@project
=
::
Project
.
find_by
(
name:
"Delta"
)
...
...
@@ -34,6 +35,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step
'I should see correct document rendered'
do
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
wait_for_ajax
expect
(
page
).
to
have_content
"All API requests require authentication"
end
...
...
@@ -63,6 +65,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step
'I should see correct maintenance file rendered'
do
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/raketasks/maintenance.md"
)
wait_for_ajax
expect
(
page
).
to
have_content
"bundle exec rake gitlab:env:info RAILS_ENV=production"
end
...
...
@@ -94,6 +97,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step
'I see correct file rendered'
do
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
wait_for_ajax
expect
(
page
).
to
have_content
"Contents"
expect
(
page
).
to
have_link
"Users"
expect
(
page
).
to
have_link
"Rake tasks"
...
...
@@ -138,6 +142,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step
'I see correct file rendered in markdown branch'
do
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
wait_for_ajax
expect
(
page
).
to
have_content
"Contents"
expect
(
page
).
to
have_link
"Users"
expect
(
page
).
to
have_link
"Rake tasks"
...
...
@@ -145,6 +150,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step
'I should see correct document rendered for markdown branch'
do
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/README.md"
)
wait_for_ajax
expect
(
page
).
to
have_content
"All API requests require authentication"
end
...
...
@@ -162,6 +168,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
# Expected link contents
step
'The link with text "empty" should have url "tree/markdown"'
do
wait_for_ajax
find
(
'a'
,
text:
/^empty$/
)[
'href'
]
==
current_host
+
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
"markdown"
)
end
...
...
@@ -197,6 +204,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end
step
'The link with text "ID" should have url "blob/markdown/README.mdID"'
do
wait_for_ajax
find
(
'a'
,
text:
/^#id$/
)[
'href'
]
==
current_host
+
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/README.md"
)
+
'#id'
end
...
...
@@ -291,10 +299,12 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step
'I should see the correct markdown'
do
expect
(
current_path
).
to
eq
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
"markdown/doc/api/users.md"
)
wait_for_ajax
expect
(
page
).
to
have_content
"List users"
end
step
'Header "Application details" should have correct id and link'
do
wait_for_ajax
header_should_have_correct_id_and_link
(
2
,
'Application details'
,
'application-details'
)
end
...
...
features/steps/shared/markdown.rb
View file @
0cfb3819
...
...
@@ -3,7 +3,7 @@ module SharedMarkdown
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
e
q
"#
#{
id
}
"
expect
(
node
[
:href
]).
to
e
nd_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
...
...
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