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
a7734bba
Commit
a7734bba
authored
Nov 16, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests after refactor
parent
af08ed6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
22 deletions
+20
-22
spec/requests/projects_security_spec.rb
spec/requests/projects_security_spec.rb
+8
-8
spec/requests/projects_tree_perfomance_spec.rb
spec/requests/projects_tree_perfomance_spec.rb
+2
-2
spec/requests/projects_tree_spec.rb
spec/requests/projects_tree_spec.rb
+10
-12
No files found.
spec/requests/projects_security_spec.rb
View file @
a7734bba
...
@@ -36,13 +36,13 @@ describe "Projects" do
...
@@ -36,13 +36,13 @@ describe "Projects" do
it
{
project_path
(
@project
).
should
be_denied_for
:visitor
}
it
{
project_path
(
@project
).
should
be_denied_for
:visitor
}
end
end
describe
"GET /project_code/tree"
do
describe
"GET /project_code/
master/
tree"
do
it
{
tree_project_
path
(
@project
).
should
be_allowed_for
@u1
}
it
{
tree_project_
ref_path
(
@project
,
@project
.
root_ref
).
should
be_allowed_for
@u1
}
it
{
tree_project_
path
(
@project
).
should
be_allowed_for
@u3
}
it
{
tree_project_
ref_path
(
@project
,
@project
.
root_ref
).
should
be_allowed_for
@u3
}
it
{
tree_project_
path
(
@project
).
should
be_denied_for
:admin
}
it
{
tree_project_
ref_path
(
@project
,
@project
.
root_ref
).
should
be_denied_for
:admin
}
it
{
tree_project_
path
(
@project
).
should
be_denied_for
@u2
}
it
{
tree_project_
ref_path
(
@project
,
@project
.
root_ref
).
should
be_denied_for
@u2
}
it
{
tree_project_
path
(
@project
).
should
be_denied_for
:user
}
it
{
tree_project_
ref_path
(
@project
,
@project
.
root_ref
).
should
be_denied_for
:user
}
it
{
tree_project_
path
(
@project
).
should
be_denied_for
:visitor
}
it
{
tree_project_
ref_path
(
@project
,
@project
.
root_ref
).
should
be_denied_for
:visitor
}
end
end
describe
"GET /project_code/commits"
do
describe
"GET /project_code/commits"
do
...
@@ -85,7 +85,7 @@ describe "Projects" do
...
@@ -85,7 +85,7 @@ describe "Projects" do
before
do
before
do
@commit
=
@project
.
commit
@commit
=
@project
.
commit
@path
=
@commit
.
tree
.
contents
.
select
{
|
i
|
i
.
is_a?
(
Grit
::
Blob
)}.
first
.
name
@path
=
@commit
.
tree
.
contents
.
select
{
|
i
|
i
.
is_a?
(
Grit
::
Blob
)}.
first
.
name
@blob_path
=
blob_project_
path
(
@project
,
:commit_id
=>
@commit
.
id
,
:path
=>
@path
)
@blob_path
=
blob_project_
ref_path
(
@project
,
@commit
.
id
,
:path
=>
@path
)
end
end
it
{
@blob_path
.
should
be_allowed_for
@u1
}
it
{
@blob_path
.
should
be_allowed_for
@u1
}
...
...
spec/requests/projects_tree_perfomance_spec.rb
View file @
a7734bba
...
@@ -14,7 +14,7 @@ describe "Projects" do
...
@@ -14,7 +14,7 @@ describe "Projects" do
it
"should be fast"
do
it
"should be fast"
do
time
=
Benchmark
.
realtime
do
time
=
Benchmark
.
realtime
do
visit
tree_project_
path
(
@project
)
visit
tree_project_
ref_path
(
@project
,
@project
.
root_ref
)
end
end
(
time
<
1.0
).
should
be_true
(
time
<
1.0
).
should
be_true
end
end
...
@@ -28,7 +28,7 @@ describe "Projects" do
...
@@ -28,7 +28,7 @@ describe "Projects" do
it
"should be fast"
do
it
"should be fast"
do
time
=
Benchmark
.
realtime
do
time
=
Benchmark
.
realtime
do
visit
tree_project_
path
(
@project
,
:commit_id
=>
ValidCommit
::
ID
)
visit
tree_project_
ref_path
(
@project
,
ValidCommit
::
ID
)
end
end
(
time
<
1.0
).
should
be_true
(
time
<
1.0
).
should
be_true
end
end
...
...
spec/requests/projects_tree_spec.rb
View file @
a7734bba
...
@@ -9,11 +9,11 @@ describe "Projects" do
...
@@ -9,11 +9,11 @@ describe "Projects" do
@project
=
Factory
:project
@project
=
Factory
:project
@project
.
add_access
(
@user
,
:read
)
@project
.
add_access
(
@user
,
:read
)
visit
tree_project_
path
(
@project
)
visit
tree_project_
ref_path
(
@project
,
@project
.
root_ref
)
end
end
it
"should be correct path"
do
it
"should be correct path"
do
current_path
.
should
==
tree_project_
path
(
@project
)
current_path
.
should
==
tree_project_
ref_path
(
@project
,
@project
.
root_ref
)
end
end
it_behaves_like
:tree_view
it_behaves_like
:tree_view
...
@@ -24,11 +24,11 @@ describe "Projects" do
...
@@ -24,11 +24,11 @@ describe "Projects" do
@project
=
Factory
:project
@project
=
Factory
:project
@project
.
add_access
(
@user
,
:read
)
@project
.
add_access
(
@user
,
:read
)
visit
tree_project_
path
(
@project
,
:commit_id
=>
ValidCommit
::
ID
)
visit
tree_project_
ref_path
(
@project
,
ValidCommit
::
ID
)
end
end
it
"should be correct path"
do
it
"should be correct path"
do
current_path
.
should
==
tree_project_
path
(
@project
)
current_path
.
should
==
tree_project_
ref_path
(
@project
,
ValidCommit
::
ID
)
end
end
it_behaves_like
:tree_view
it_behaves_like
:tree_view
...
@@ -40,11 +40,11 @@ describe "Projects" do
...
@@ -40,11 +40,11 @@ describe "Projects" do
@project
=
Factory
:project
@project
=
Factory
:project
@project
.
add_access
(
@user
,
:read
)
@project
.
add_access
(
@user
,
:read
)
visit
tree_project_
path
(
@project
,
:branch
=>
"master"
)
visit
tree_project_
ref_path
(
@project
,
@project
.
root_ref
)
end
end
it
"should be correct path"
do
it
"should be correct path"
do
current_path
.
should
==
tree_project_path
(
@project
)
current_path
.
should
==
tree_project_ref_path
(
@project
,
@project
.
root_ref
)
end
end
it_behaves_like
:tree_view
it_behaves_like
:tree_view
...
@@ -57,11 +57,11 @@ describe "Projects" do
...
@@ -57,11 +57,11 @@ describe "Projects" do
@project
=
Factory
:project
@project
=
Factory
:project
@project
.
add_access
(
@user
,
:read
)
@project
.
add_access
(
@user
,
:read
)
visit
tree_project_
path
(
@project
,
:path
=>
".rvmrc"
)
visit
tree_project_
ref_path
(
@project
,
@project
.
root_ref
,
:path
=>
".rvmrc"
)
end
end
it
"should be correct path"
do
it
"should be correct path"
do
current_path
.
should
==
tree_project_
path
(
@project
)
current_path
.
should
==
tree_project_
ref_path
(
@project
,
@project
.
root_ref
)
end
end
it
"should contain file view"
do
it
"should contain file view"
do
...
@@ -76,13 +76,11 @@ describe "Projects" do
...
@@ -76,13 +76,11 @@ describe "Projects" do
@project
=
Factory
:project
@project
=
Factory
:project
@project
.
add_access
(
@user
,
:read
)
@project
.
add_access
(
@user
,
:read
)
visit
blob_project_path
(
@project
,
visit
blob_project_ref_path
(
@project
,
ValidCommit
::
ID
,
:path
=>
ValidCommit
::
BLOB_FILE_PATH
)
:path
=>
ValidCommit
::
BLOB_FILE_PATH
,
:commit_id
=>
ValidCommit
::
ID
)
end
end
it
"should be correct path"
do
it
"should be correct path"
do
current_path
.
should
==
blob_project_
path
(
@project
)
current_path
.
should
==
blob_project_
ref_path
(
@project
,
ValidCommit
::
ID
)
end
end
it
"raw file response"
do
it
"raw file response"
do
...
...
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