summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorgitlabhq <m@gitlabhq.com>2011-11-16 08:58:53 +0300
committergitlabhq <m@gitlabhq.com>2011-11-16 08:58:53 +0300
commita7734bba845e1079f7859f95f10be2c5b65cfded (patch)
tree8116de2bbcaab409f1c7472f186e5e99aa0a79e8 /spec
parentaf08ed6b66530b8efc68bf45e1f11599e333b826 (diff)
downloadgitlab-ce-a7734bba845e1079f7859f95f10be2c5b65cfded.tar.gz
fix tests after refactor
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/projects_security_spec.rb16
-rw-r--r--spec/requests/projects_tree_perfomance_spec.rb4
-rw-r--r--spec/requests/projects_tree_spec.rb22
3 files changed, 20 insertions, 22 deletions
diff --git a/spec/requests/projects_security_spec.rb b/spec/requests/projects_security_spec.rb
index 1d42c5e7c53..4d0c8a642f9 100644
--- a/spec/requests/projects_security_spec.rb
+++ b/spec/requests/projects_security_spec.rb
@@ -36,13 +36,13 @@ describe "Projects" do
it { project_path(@project).should be_denied_for :visitor }
end
- describe "GET /project_code/tree" do
- it { tree_project_path(@project).should be_allowed_for @u1 }
- it { tree_project_path(@project).should be_allowed_for @u3 }
- it { tree_project_path(@project).should be_denied_for :admin }
- it { tree_project_path(@project).should be_denied_for @u2 }
- it { tree_project_path(@project).should be_denied_for :user }
- it { tree_project_path(@project).should be_denied_for :visitor }
+ describe "GET /project_code/master/tree" do
+ it { tree_project_ref_path(@project, @project.root_ref).should be_allowed_for @u1 }
+ it { tree_project_ref_path(@project, @project.root_ref).should be_allowed_for @u3 }
+ it { tree_project_ref_path(@project, @project.root_ref).should be_denied_for :admin }
+ it { tree_project_ref_path(@project, @project.root_ref).should be_denied_for @u2 }
+ it { tree_project_ref_path(@project, @project.root_ref).should be_denied_for :user }
+ it { tree_project_ref_path(@project, @project.root_ref).should be_denied_for :visitor }
end
describe "GET /project_code/commits" do
@@ -85,7 +85,7 @@ describe "Projects" do
before do
@commit = @project.commit
@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
it { @blob_path.should be_allowed_for @u1 }
diff --git a/spec/requests/projects_tree_perfomance_spec.rb b/spec/requests/projects_tree_perfomance_spec.rb
index bf3ca167d31..5cf93bf9fbc 100644
--- a/spec/requests/projects_tree_perfomance_spec.rb
+++ b/spec/requests/projects_tree_perfomance_spec.rb
@@ -14,7 +14,7 @@ describe "Projects" do
it "should be fast" do
time = Benchmark.realtime do
- visit tree_project_path(@project)
+ visit tree_project_ref_path(@project, @project.root_ref)
end
(time < 1.0).should be_true
end
@@ -28,7 +28,7 @@ describe "Projects" do
it "should be fast" do
time = Benchmark.realtime do
- visit tree_project_path(@project, :commit_id => ValidCommit::ID)
+ visit tree_project_ref_path(@project, ValidCommit::ID)
end
(time < 1.0).should be_true
end
diff --git a/spec/requests/projects_tree_spec.rb b/spec/requests/projects_tree_spec.rb
index fd49ffaab5c..fe4f81b39e7 100644
--- a/spec/requests/projects_tree_spec.rb
+++ b/spec/requests/projects_tree_spec.rb
@@ -9,11 +9,11 @@ describe "Projects" do
@project = Factory :project
@project.add_access(@user, :read)
- visit tree_project_path(@project)
+ visit tree_project_ref_path(@project, @project.root_ref)
end
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
it_behaves_like :tree_view
@@ -24,11 +24,11 @@ describe "Projects" do
@project = Factory :project
@project.add_access(@user, :read)
- visit tree_project_path(@project, :commit_id => ValidCommit::ID)
+ visit tree_project_ref_path(@project, ValidCommit::ID)
end
it "should be correct path" do
- current_path.should == tree_project_path(@project)
+ current_path.should == tree_project_ref_path(@project, ValidCommit::ID)
end
it_behaves_like :tree_view
@@ -40,11 +40,11 @@ describe "Projects" do
@project = Factory :project
@project.add_access(@user, :read)
- visit tree_project_path(@project, :branch => "master")
+ visit tree_project_ref_path(@project, @project.root_ref)
end
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
it_behaves_like :tree_view
@@ -57,11 +57,11 @@ describe "Projects" do
@project = Factory :project
@project.add_access(@user, :read)
- visit tree_project_path(@project, :path => ".rvmrc")
+ visit tree_project_ref_path(@project, @project.root_ref, :path => ".rvmrc")
end
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
it "should contain file view" do
@@ -76,13 +76,11 @@ describe "Projects" do
@project = Factory :project
@project.add_access(@user, :read)
- visit blob_project_path(@project,
- :path => ValidCommit::BLOB_FILE_PATH,
- :commit_id => ValidCommit::ID)
+ visit blob_project_ref_path(@project, ValidCommit::ID, :path => ValidCommit::BLOB_FILE_PATH)
end
it "should be correct path" do
- current_path.should == blob_project_path(@project)
+ current_path.should == blob_project_ref_path(@project, ValidCommit::ID)
end
it "raw file response" do