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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
f40e0171
Commit
f40e0171
authored
Oct 11, 2013
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test if markdown is rendered properly.
parent
c0725188
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
228 additions
and
5 deletions
+228
-5
features/project/source/markdown_render.feature
features/project/source/markdown_render.feature
+70
-0
features/steps/project/project_markdown_render.rb
features/steps/project/project_markdown_render.rb
+153
-0
spec/lib/gitlab/satellite/merge_action_spec.rb
spec/lib/gitlab/satellite/merge_action_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+4
-4
spec/seed_project.tar.gz
spec/seed_project.tar.gz
+0
-0
No files found.
features/project/source/markdown_render.feature
0 → 100644
View file @
f40e0171
Feature
:
Project markdown render
Background
:
Given
I sign in as a user
And
I own project
"Delta"
Given
I visit project source page
Scenario
:
I
browse files from master branch
Then
I should see files from repository in master
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
Scenario
:
I
view README in master branch
Then
I should see files from repository in master
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
Scenario
:
I
navigate to doc directory to view documentation in master
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
Scenario
:
I
navigate to doc directory to view user doc in master
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
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
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
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
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
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
features/steps/project/project_markdown_render.rb
0 → 100644
View file @
f40e0171
class
Spinach::Features::ProjectMarkdownRender
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
And
'I own project "Delta"'
do
@project
=
Project
.
find_by_name
"Delta"
@project
||=
create
(
:project_with_code
,
name:
"Delta"
,
namespace:
@user
.
namespace
)
@project
.
team
<<
[
@user
,
:master
]
end
Then
'I should see files from repository in master'
do
current_path
.
should
==
project_tree_path
(
@project
,
"master"
)
page
.
should
have_content
"Gemfile"
page
.
should
have_content
"app"
page
.
should
have_content
"README"
end
And
'I should see rendered README which contains correct links'
do
page
.
should
have_content
"Welcome to GitLab GitLab is a free project and repository management application"
page
.
should
have_link
"GitLab API doc"
page
.
should
have_link
"GitLab API website"
page
.
should
have_link
"Rake tasks"
page
.
should
have_link
"backup and restore procedure"
end
And
'I click on Gitlab API in README'
do
click_link
"GitLab API doc"
end
Then
'I should see correct document rendered'
do
current_path
.
should
==
project_blob_path
(
@project
,
"master/doc/api/README.md"
)
page
.
should
have_content
"All API requests require authentication"
end
And
'I click on Rake tasks in README'
do
click_link
"Rake tasks"
end
Then
'I should see correct directory rendered'
do
current_path
.
should
==
project_tree_path
(
@project
,
"master/doc/raketasks"
)
page
.
should
have_content
"backup_restore.md"
page
.
should
have_content
"maintenance.md"
end
And
'I navigate to the doc/api/README'
do
click_link
"doc"
click_link
"api"
click_link
"README.md"
end
And
'I see correct file rendered'
do
current_path
.
should
==
project_blob_path
(
@project
,
"master/doc/api/README.md"
)
page
.
should
have_content
"Contents"
page
.
should
have_link
"Users"
page
.
should
have_link
"Rake tasks"
end
And
'I click on users in doc/api/README'
do
click_link
"Users"
end
Then
'I should see the correct document file'
do
current_path
.
should
==
project_blob_path
(
@project
,
"master/doc/api/users.md"
)
page
.
should
have_content
"Get a list of users."
end
And
'I click on raketasks in doc/api/README'
do
click_link
"Rake tasks"
end
When
'I visit markdown branch'
do
visit
project_tree_path
(
@project
,
"markdown"
)
end
Then
'I should see files from repository in markdown branch'
do
current_path
.
should
==
project_tree_path
(
@project
,
"markdown"
)
page
.
should
have_content
"Gemfile"
page
.
should
have_content
"app"
page
.
should
have_content
"README"
end
And
'I see correct file rendered in markdown branch'
do
current_path
.
should
==
project_blob_path
(
@project
,
"markdown/doc/api/README.md"
)
page
.
should
have_content
"Contents"
page
.
should
have_link
"Users"
page
.
should
have_link
"Rake tasks"
end
Then
'I should see correct document rendered for markdown branch'
do
current_path
.
should
==
project_blob_path
(
@project
,
"markdown/doc/api/README.md"
)
page
.
should
have_content
"All API requests require authentication"
end
Then
'I should see correct directory rendered for markdown branch'
do
current_path
.
should
==
project_tree_path
(
@project
,
"markdown/doc/raketasks"
)
page
.
should
have_content
"backup_restore.md"
page
.
should
have_content
"maintenance.md"
end
Then
'I should see the users document file in markdown branch'
do
current_path
.
should
==
project_blob_path
(
@project
,
"markdown/doc/api/users.md"
)
page
.
should
have_content
"Get a list of users."
end
Given
'I go to wiki page'
do
click_link
"Wiki"
current_path
.
should
==
project_wiki_path
(
@project
,
"home"
)
end
And
'I add various links to the wiki page'
do
fill_in
"wiki[content]"
,
with:
"[test](test)
\n
[GitLab API doc](doc/api/README.md)
\n
[Rake tasks](doc/raketasks)
\n
"
fill_in
"wiki[message]"
,
with:
"Adding links to wiki"
click_button
"Create page"
end
Then
'Wiki page should have added links'
do
current_path
.
should
==
project_wiki_path
(
@project
,
"home"
)
page
.
should
have_content
"test GitLab API doc Rake tasks"
end
And
'I click on test link'
do
click_link
"test"
end
Then
'I see new wiki page named test'
do
current_path
.
should
==
project_wiki_path
(
@project
,
"test"
)
page
.
should
have_content
"Editing page"
end
When
'I go back to wiki page home'
do
visit
project_wiki_path
(
@project
,
"home"
)
current_path
.
should
==
project_wiki_path
(
@project
,
"home"
)
end
And
'I click on GitLab API doc link'
do
click_link
"GitLab API"
end
Then
'I see Gitlab API document'
do
current_path
.
should
==
project_blob_path
(
@project
,
"master/doc/api/README.md"
)
page
.
should
have_content
"Status codes"
end
And
'I click on Rake tasks link'
do
click_link
"Rake tasks"
end
Then
'I see Rake tasks directory'
do
current_path
.
should
==
project_tree_path
(
@project
,
"master/doc/raketasks"
)
page
.
should
have_content
"backup_restore.md"
page
.
should
have_content
"maintenance.md"
end
end
\ No newline at end of file
spec/lib/gitlab/satellite/merge_action_spec.rb
View file @
f40e0171
...
@@ -3,7 +3,7 @@ require 'spec_helper'
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
'Gitlab::Satellite::MergeAction'
do
describe
'Gitlab::Satellite::MergeAction'
do
before
(
:each
)
do
before
(
:each
)
do
# TestEnv.init(mailer: false, init_repos: true, repos: true)
# TestEnv.init(mailer: false, init_repos: true, repos: true)
@master
=
[
'master'
,
'b
cf03b5de6c33f3869ef70d68cf06e679d1d7f9a
'
]
@master
=
[
'master'
,
'b
1e6a9dbf1c85e6616497a5e7bad9143a4bd0828
'
]
@one_after_stable
=
[
'stable'
,
'6ea87c47f0f8a24ae031c3fff17bc913889ecd00'
]
#this commit sha is one after stable
@one_after_stable
=
[
'stable'
,
'6ea87c47f0f8a24ae031c3fff17bc913889ecd00'
]
#this commit sha is one after stable
@wiki_branch
=
[
'wiki'
,
'635d3e09b72232b6e92a38de6cc184147e5bcb41'
]
#this is the commit sha where the wiki branch goes off from master
@wiki_branch
=
[
'wiki'
,
'635d3e09b72232b6e92a38de6cc184147e5bcb41'
]
#this is the commit sha where the wiki branch goes off from master
@conflicting_metior
=
[
'metior'
,
'313d96e42b313a0af5ab50fa233bf43e27118b3f'
]
#this branch conflicts with the wiki branch
@conflicting_metior
=
[
'metior'
,
'313d96e42b313a0af5ab50fa233bf43e27118b3f'
]
#this branch conflicts with the wiki branch
...
...
spec/models/project_spec.rb
View file @
f40e0171
...
@@ -132,17 +132,17 @@ describe Project do
...
@@ -132,17 +132,17 @@ describe Project do
it
"should close merge request if last commit from source branch was pushed to target branch"
do
it
"should close merge request if last commit from source branch was pushed to target branch"
do
@merge_request
.
reloaded_commits
@merge_request
.
reloaded_commits
@merge_request
.
last_commit
.
id
.
should
==
"b
cf03b5de6c33f3869ef70d68cf06e679d1d7f9a
"
@merge_request
.
last_commit
.
id
.
should
==
"b
1e6a9dbf1c85e6616497a5e7bad9143a4bd0828
"
project
.
update_merge_requests
(
"8716fc78f3c65bbf7bcf7b574febd583bc5d2812"
,
"b
cf03b5de6c33f3869ef70d68cf06e679d1d7f9a
"
,
"refs/heads/stable"
,
@key
.
user
)
project
.
update_merge_requests
(
"8716fc78f3c65bbf7bcf7b574febd583bc5d2812"
,
"b
1e6a9dbf1c85e6616497a5e7bad9143a4bd0828
"
,
"refs/heads/stable"
,
@key
.
user
)
@merge_request
.
reload
@merge_request
.
reload
@merge_request
.
merged?
.
should
be_true
@merge_request
.
merged?
.
should
be_true
end
end
it
"should update merge request commits with new one if pushed to source branch"
do
it
"should update merge request commits with new one if pushed to source branch"
do
@merge_request
.
last_commit
.
should
==
nil
@merge_request
.
last_commit
.
should
==
nil
project
.
update_merge_requests
(
"8716fc78f3c65bbf7bcf7b574febd583bc5d2812"
,
"b
cf03b5de6c33f3869ef70d68cf06e679d1d7f9a
"
,
"refs/heads/master"
,
@key
.
user
)
project
.
update_merge_requests
(
"8716fc78f3c65bbf7bcf7b574febd583bc5d2812"
,
"b
1e6a9dbf1c85e6616497a5e7bad9143a4bd0828
"
,
"refs/heads/master"
,
@key
.
user
)
@merge_request
.
reload
@merge_request
.
reload
@merge_request
.
last_commit
.
id
.
should
==
"b
cf03b5de6c33f3869ef70d68cf06e679d1d7f9a
"
@merge_request
.
last_commit
.
id
.
should
==
"b
1e6a9dbf1c85e6616497a5e7bad9143a4bd0828
"
end
end
end
end
...
...
spec/seed_project.tar.gz
View file @
f40e0171
No preview for this file type
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