BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3032989a
Unverified
Commit
3032989a
authored
Dec 12, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added specs
parent
e001f4b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
tree_show_spec.rb
spec/features/projects/tree/tree_show_spec.rb
+28
-0
_blob_item.html.haml_spec.rb
spec/views/projects/tree/_blob_item.html.haml_spec.rb
+40
-0
No files found.
spec/features/projects/tree/tree_show_spec.rb
0 → 100644
View file @
3032989a
require
'spec_helper'
feature
'Projects tree'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
project
.
add_master
(
user
)
sign_in
(
user
)
visit
project_tree_path
(
project
,
'master'
)
end
it
'renders tree table'
do
expect
(
page
).
to
have_selector
(
'.tree-item'
)
expect
(
page
).
not_to
have_selector
(
'.label-lfs'
,
text:
'LFS'
)
end
context
'LFS'
do
before
do
visit
project_tree_path
(
project
,
File
.
join
(
'master'
,
'files/lfs'
))
end
it
'renders LFS badge on blob item'
do
expect
(
page
).
to
have_selector
(
'.label-lfs'
,
text:
'LFS'
)
end
end
end
spec/views/projects/tree/_blob_item.html.haml_spec.rb
0 → 100644
View file @
3032989a
require
'spec_helper'
describe
'projects/tree/_blob_item'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:repository
)
{
project
.
repository
}
let
(
:blob_item
)
{
Gitlab
::
Git
::
Tree
.
where
(
repository
,
SeedRepo
::
Commit
::
ID
,
'files/ruby'
).
first
}
before
do
assign
(
:project
,
project
)
assign
(
:repository
,
repository
)
assign
(
:id
,
File
.
join
(
'master'
,
''
))
assign
(
:lfs_blobs
,
[])
end
it
'renders blob item'
do
render_partial
(
blob_item
)
expect
(
rendered
).
to
have_content
(
blob_item
.
name
)
expect
(
rendered
).
not_to
have_selector
(
'.label-lfs'
,
text:
'LFS'
)
end
describe
'LFS blob'
do
before
do
assign
(
:lfs_blobs
,
[
blob_item
])
render_partial
(
blob_item
)
end
it
'renders LFS badge'
do
expect
(
rendered
).
to
have_selector
(
'.label-lfs'
,
text:
'LFS'
)
end
end
def
render_partial
(
blob_item
)
render
partial:
'projects/tree/blob_item'
,
locals:
{
blob_item:
blob_item
,
type:
'blob'
}
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