Commit a7734bba845e1079f7859f95f10be2c5b65cfded
1 parent
af08ed6b
Exists in
master
and in
4 other branches
fix tests after refactor
Showing
3 changed files
with
20 additions
and
22 deletions
Show diff stats
spec/requests/projects_security_spec.rb
... | ... | @@ -36,13 +36,13 @@ describe "Projects" do |
36 | 36 | it { project_path(@project).should be_denied_for :visitor } |
37 | 37 | end |
38 | 38 | |
39 | - describe "GET /project_code/tree" do | |
40 | - it { tree_project_path(@project).should be_allowed_for @u1 } | |
41 | - it { tree_project_path(@project).should be_allowed_for @u3 } | |
42 | - it { tree_project_path(@project).should be_denied_for :admin } | |
43 | - it { tree_project_path(@project).should be_denied_for @u2 } | |
44 | - it { tree_project_path(@project).should be_denied_for :user } | |
45 | - it { tree_project_path(@project).should be_denied_for :visitor } | |
39 | + describe "GET /project_code/master/tree" do | |
40 | + it { tree_project_ref_path(@project, @project.root_ref).should be_allowed_for @u1 } | |
41 | + it { tree_project_ref_path(@project, @project.root_ref).should be_allowed_for @u3 } | |
42 | + it { tree_project_ref_path(@project, @project.root_ref).should be_denied_for :admin } | |
43 | + it { tree_project_ref_path(@project, @project.root_ref).should be_denied_for @u2 } | |
44 | + it { tree_project_ref_path(@project, @project.root_ref).should be_denied_for :user } | |
45 | + it { tree_project_ref_path(@project, @project.root_ref).should be_denied_for :visitor } | |
46 | 46 | end |
47 | 47 | |
48 | 48 | describe "GET /project_code/commits" do |
... | ... | @@ -85,7 +85,7 @@ describe "Projects" do |
85 | 85 | before do |
86 | 86 | @commit = @project.commit |
87 | 87 | @path = @commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name |
88 | - @blob_path = blob_project_path(@project, :commit_id => @commit.id, :path => @path) | |
88 | + @blob_path = blob_project_ref_path(@project, @commit.id, :path => @path) | |
89 | 89 | end |
90 | 90 | |
91 | 91 | it { @blob_path.should be_allowed_for @u1 } | ... | ... |
spec/requests/projects_tree_perfomance_spec.rb
... | ... | @@ -14,7 +14,7 @@ describe "Projects" do |
14 | 14 | |
15 | 15 | it "should be fast" do |
16 | 16 | time = Benchmark.realtime do |
17 | - visit tree_project_path(@project) | |
17 | + visit tree_project_ref_path(@project, @project.root_ref) | |
18 | 18 | end |
19 | 19 | (time < 1.0).should be_true |
20 | 20 | end |
... | ... | @@ -28,7 +28,7 @@ describe "Projects" do |
28 | 28 | |
29 | 29 | it "should be fast" do |
30 | 30 | time = Benchmark.realtime do |
31 | - visit tree_project_path(@project, :commit_id => ValidCommit::ID) | |
31 | + visit tree_project_ref_path(@project, ValidCommit::ID) | |
32 | 32 | end |
33 | 33 | (time < 1.0).should be_true |
34 | 34 | end | ... | ... |
spec/requests/projects_tree_spec.rb
... | ... | @@ -9,11 +9,11 @@ describe "Projects" do |
9 | 9 | @project = Factory :project |
10 | 10 | @project.add_access(@user, :read) |
11 | 11 | |
12 | - visit tree_project_path(@project) | |
12 | + visit tree_project_ref_path(@project, @project.root_ref) | |
13 | 13 | end |
14 | 14 | |
15 | 15 | it "should be correct path" do |
16 | - current_path.should == tree_project_path(@project) | |
16 | + current_path.should == tree_project_ref_path(@project, @project.root_ref) | |
17 | 17 | end |
18 | 18 | |
19 | 19 | it_behaves_like :tree_view |
... | ... | @@ -24,11 +24,11 @@ describe "Projects" do |
24 | 24 | @project = Factory :project |
25 | 25 | @project.add_access(@user, :read) |
26 | 26 | |
27 | - visit tree_project_path(@project, :commit_id => ValidCommit::ID) | |
27 | + visit tree_project_ref_path(@project, ValidCommit::ID) | |
28 | 28 | end |
29 | 29 | |
30 | 30 | it "should be correct path" do |
31 | - current_path.should == tree_project_path(@project) | |
31 | + current_path.should == tree_project_ref_path(@project, ValidCommit::ID) | |
32 | 32 | end |
33 | 33 | |
34 | 34 | it_behaves_like :tree_view |
... | ... | @@ -40,11 +40,11 @@ describe "Projects" do |
40 | 40 | @project = Factory :project |
41 | 41 | @project.add_access(@user, :read) |
42 | 42 | |
43 | - visit tree_project_path(@project, :branch => "master") | |
43 | + visit tree_project_ref_path(@project, @project.root_ref) | |
44 | 44 | end |
45 | 45 | |
46 | 46 | it "should be correct path" do |
47 | - current_path.should == tree_project_path(@project) | |
47 | + current_path.should == tree_project_ref_path(@project, @project.root_ref) | |
48 | 48 | end |
49 | 49 | |
50 | 50 | it_behaves_like :tree_view |
... | ... | @@ -57,11 +57,11 @@ describe "Projects" do |
57 | 57 | @project = Factory :project |
58 | 58 | @project.add_access(@user, :read) |
59 | 59 | |
60 | - visit tree_project_path(@project, :path => ".rvmrc") | |
60 | + visit tree_project_ref_path(@project, @project.root_ref, :path => ".rvmrc") | |
61 | 61 | end |
62 | 62 | |
63 | 63 | it "should be correct path" do |
64 | - current_path.should == tree_project_path(@project) | |
64 | + current_path.should == tree_project_ref_path(@project, @project.root_ref) | |
65 | 65 | end |
66 | 66 | |
67 | 67 | it "should contain file view" do |
... | ... | @@ -76,13 +76,11 @@ describe "Projects" do |
76 | 76 | @project = Factory :project |
77 | 77 | @project.add_access(@user, :read) |
78 | 78 | |
79 | - visit blob_project_path(@project, | |
80 | - :path => ValidCommit::BLOB_FILE_PATH, | |
81 | - :commit_id => ValidCommit::ID) | |
79 | + visit blob_project_ref_path(@project, ValidCommit::ID, :path => ValidCommit::BLOB_FILE_PATH) | |
82 | 80 | end |
83 | 81 | |
84 | 82 | it "should be correct path" do |
85 | - current_path.should == blob_project_path(@project) | |
83 | + current_path.should == blob_project_ref_path(@project, ValidCommit::ID) | |
86 | 84 | end |
87 | 85 | |
88 | 86 | it "raw file response" do | ... | ... |