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
Jérome Perrin
gitlab-ce
Commits
442a0663
Commit
442a0663
authored
May 29, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature specs for Project and Group description rendering
parent
023dd290
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
12 deletions
+82
-12
spec/features/groups_spec.rb
spec/features/groups_spec.rb
+36
-0
spec/features/markdown_spec.rb
spec/features/markdown_spec.rb
+2
-0
spec/features/projects_spec.rb
spec/features/projects_spec.rb
+44
-12
No files found.
spec/features/groups_spec.rb
0 → 100644
View file @
442a0663
require
'spec_helper'
feature
'Group'
do
describe
'description'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:path
)
{
group_path
(
group
)
}
before
do
login_as
(
:admin
)
end
it
'parses Markdown'
do
group
.
update_attribute
(
:description
,
'This is **my** group'
)
visit
path
expect
(
page
).
to
have_css
(
'.description > p > strong'
)
end
it
'passes through html-pipeline'
do
group
.
update_attribute
(
:description
,
'This group is the :poop:'
)
visit
path
expect
(
page
).
to
have_css
(
'.description > p > img'
)
end
it
'sanitizes unwanted tags'
do
group
.
update_attribute
(
:description
,
'# Group Description'
)
visit
path
expect
(
page
).
not_to
have_css
(
'.description h1'
)
end
it
'permits `rel` attribute on links'
do
group
.
update_attribute
(
:description
,
'https://google.com/'
)
visit
path
expect
(
page
).
to
have_css
(
'.description a[rel]'
)
end
end
end
spec/features/markdown_spec.rb
View file @
442a0663
...
...
@@ -18,11 +18,13 @@ require 'erb'
# -> `gfm_with_options` helper
# -> HTML::Pipeline
# -> Sanitize
# -> RelativeLink
# -> Emoji
# -> Table of Contents
# -> Autolinks
# -> Rinku (http, https, ftp)
# -> Other schemes
# -> ExternalLink
# -> References
# -> TaskList
# -> `html_safe`
...
...
spec/features/projects_spec.rb
View file @
442a0663
require
'spec_helper'
describe
"Projects"
,
feature:
true
,
js:
true
do
before
{
login_as
:user
}
feature
'Project'
do
describe
'description'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:path
)
{
namespace_project_path
(
project
.
namespace
,
project
)
}
describe
"DELETE /projects/:id"
do
before
do
@project
=
create
(
:project
,
namespace:
@user
.
namespace
)
@project
.
team
<<
[
@user
,
:master
]
visit
edit_namespace_project_path
(
@project
.
namespace
,
@project
)
login_as
(
:admin
)
end
it
"should remove project"
do
it
'parses Markdown'
do
project
.
update_attribute
(
:description
,
'This is **my** project'
)
visit
path
expect
(
page
).
to
have_css
(
'.project-home-desc > p > strong'
)
end
it
'passes through html-pipeline'
do
project
.
update_attribute
(
:description
,
'This project is the :poop:'
)
visit
path
expect
(
page
).
to
have_css
(
'.project-home-desc > p > img'
)
end
it
'sanitizes unwanted tags'
do
project
.
update_attribute
(
:description
,
'# Project Description'
)
visit
path
expect
(
page
).
not_to
have_css
(
'.project-home-desc h1'
)
end
it
'permits `rel` attribute on links'
do
project
.
update_attribute
(
:description
,
'https://google.com/'
)
visit
path
expect
(
page
).
to
have_css
(
'.project-home-desc a[rel]'
)
end
end
describe
'removal'
,
js:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
before
do
login_with
(
user
)
project
.
team
<<
[
user
,
:master
]
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
end
it
'should remove project'
do
expect
{
remove_project
}.
to
change
{
Project
.
count
}.
by
(
-
1
)
end
it
'should delete the project from disk'
do
expect
(
GitlabShellWorker
).
to
(
receive
(
:perform_async
).
with
(
:remove_repository
,
/
#{
@project
.
path_with_namespace
}
/
)
).
twice
expect
(
GitlabShellWorker
).
to
receive
(
:perform_async
).
with
(
:remove_repository
,
/
#{
project
.
path_with_namespace
}
/
).
twice
remove_project
end
...
...
@@ -26,7 +58,7 @@ describe "Projects", feature: true, js: true do
def
remove_project
click_link
"Remove project"
fill_in
'confirm_name_input'
,
with:
@
project
.
path
fill_in
'confirm_name_input'
,
with:
project
.
path
click_button
'Confirm'
end
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