Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
dfeef6c2
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dfeef6c2
编写于
4月 03, 2013
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed API file raw functionality, Fixed tree controller tests. Added BlobController specs
上级
413a310f
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
67 addition
and
31 deletion
+67
-31
app/views/tree/_tree.html.haml
app/views/tree/_tree.html.haml
+18
-21
lib/api/projects.rb
lib/api/projects.rb
+7
-5
spec/controllers/blob_controller_spec.rb
spec/controllers/blob_controller_spec.rb
+37
-0
spec/controllers/tree_controller_spec.rb
spec/controllers/tree_controller_spec.rb
+3
-3
spec/models/commit_spec.rb
spec/models/commit_spec.rb
+2
-2
未找到文件。
app/views/tree/_tree.html.haml
浏览文件 @
dfeef6c2
...
...
@@ -12,9 +12,6 @@
=
link_to
title
,
'#'
%div
#tree-content-holder
.tree-content-holder
-
if
tree
.
is_blob?
=
render
"tree/blob"
,
blob:
tree
-
else
%table
#tree-slider
{
class:
"table_#{@hex_path} tree-table"
}
%thead
%tr
...
...
lib/api/projects.rb
浏览文件 @
dfeef6c2
...
...
@@ -493,14 +493,16 @@ module Gitlab
ref
=
params
[
:sha
]
commit
=
user_project
.
repository
.
commit
ref
repo
=
user_project
.
repository
commit
=
repo
.
commit
(
ref
)
not_found!
"Commit"
unless
commit
tree
=
Tree
.
new
commit
.
tree
,
ref
,
params
[
:filepath
]
not_found!
"File"
unless
tree
.
try
(
:tree
)
blob
=
Gitlab
::
Git
::
Blob
.
new
(
repo
,
commit
.
id
,
ref
,
params
[
:filepath
])
not_found!
"File"
unless
blob
.
exists?
content_type
tree
.
mime_type
present
tree
.
data
content_type
blob
.
mime_type
present
blob
.
data
end
# Get a specific project's keys
...
...
spec/controllers/blob_controller_spec.rb
0 → 100644
浏览文件 @
dfeef6c2
require
'spec_helper'
describe
BlobController
do
let
(
:project
)
{
create
(
:project_with_code
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
project
.
team
<<
[
user
,
:master
]
project
.
stub
(
:branches
).
and_return
([
'master'
,
'foo/bar/baz'
])
project
.
stub
(
:tags
).
and_return
([
'v1.0.0'
,
'v2.0.0'
])
controller
.
instance_variable_set
(
:@project
,
project
)
end
describe
"GET show"
do
render_views
before
{
get
:show
,
project_id:
project
.
code
,
id:
id
}
context
"valid branch, valid file"
do
let
(
:id
)
{
'master/README.md'
}
it
{
should
respond_with
(
:success
)
}
end
context
"valid branch, invalid file"
do
let
(
:id
)
{
'master/invalid-path.rb'
}
it
{
should
respond_with
(
:not_found
)
}
end
context
"invalid branch, valid file"
do
let
(
:id
)
{
'invalid-branch/README.md'
}
it
{
should
respond_with
(
:not_found
)
}
end
end
end
spec/controllers/tree_controller_spec.rb
浏览文件 @
dfeef6c2
...
...
@@ -26,17 +26,17 @@ describe TreeController do
end
context
"valid branch, valid path"
do
let
(
:id
)
{
'master/
README.md
'
}
let
(
:id
)
{
'master/
app/
'
}
it
{
should
respond_with
(
:success
)
}
end
context
"valid branch, invalid path"
do
let
(
:id
)
{
'master/invalid-path
.rb
'
}
let
(
:id
)
{
'master/invalid-path
/
'
}
it
{
should
respond_with
(
:not_found
)
}
end
context
"invalid branch, valid path"
do
let
(
:id
)
{
'invalid-branch/
README.md
'
}
let
(
:id
)
{
'invalid-branch/
app/
'
}
it
{
should
respond_with
(
:not_found
)
}
end
end
...
...
spec/models/commit_spec.rb
浏览文件 @
dfeef6c2
...
...
@@ -38,10 +38,10 @@ describe Commit do
it
{
should
respond_to
(
:message
)
}
it
{
should
respond_to
(
:authored_date
)
}
it
{
should
respond_to
(
:committed_date
)
}
it
{
should
respond_to
(
:committer_email
)
}
it
{
should
respond_to
(
:author_email
)
}
it
{
should
respond_to
(
:parents
)
}
it
{
should
respond_to
(
:date
)
}
it
{
should
respond_to
(
:committer
)
}
it
{
should
respond_to
(
:author
)
}
it
{
should
respond_to
(
:diffs
)
}
it
{
should
respond_to
(
:tree
)
}
it
{
should
respond_to
(
:id
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录