diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-09-17 21:49:57 +0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-27 00:32:22 +0400 |
commit | 576cec6c67dcc4ee00b8220ca1a45385583e25b2 (patch) | |
tree | 3fc61345a7a2ec716dbed39fd4916a8f2d3f9dc4 /spec | |
parent | 39c657930625ddc3ac8a921f01ffc83acadce68f (diff) |
Add BlobController, remove Refs#blob
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/security/project_access_spec.rb | 2 | ||||
-rw-r--r-- | spec/routing/project_routing_spec.rb | 17 |
2 files changed, 7 insertions, 12 deletions
diff --git a/spec/requests/security/project_access_spec.rb b/spec/requests/security/project_access_spec.rb index 4b6abd3e148..9b07df6c74d 100644 --- a/spec/requests/security/project_access_spec.rb +++ b/spec/requests/security/project_access_spec.rb @@ -95,7 +95,7 @@ describe "Application access" do before do commit = @project.commit path = commit.tree.contents.select { |i| i.is_a?(Grit::Blob)}.first.name - @blob_path = blob_project_ref_path(@project, commit.id, path: path) + @blob_path = project_blob_path(@project, File.join(commit.id, path)) end it { @blob_path.should be_allowed_for @u1 } diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index 303df02c08b..01bc303deee 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -192,7 +192,6 @@ describe ProtectedBranchesController, "routing" do end # switch_project_refs GET /:project_id/switch(.:format) refs#switch -# blob_project_ref GET /:project_id/:id/blob(.:format) refs#blob # logs_tree_project_ref GET /:project_id/:id/logs_tree(.:format) refs#logs_tree # logs_file_project_ref GET /:project_id/:id/logs_tree/:path(.:format) refs#logs_tree describe RefsController, "routing" do @@ -204,10 +203,6 @@ describe RefsController, "routing" do get("/gitlabhq/stable/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable') get("/gitlabhq/stable/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz') end - - it "to #blob" do - get("/gitlabhq/stable/blob").should route_to('refs#blob', project_id: 'gitlabhq', id: 'stable') - end end # diffs_project_merge_request GET /:project_id/merge_requests/:id/diffs(.:format) merge_requests#diffs @@ -400,6 +395,12 @@ describe BlameController, "routing" do end end +describe BlobController, "routing" do + it "to #show" do + get("/gitlabhq/blob/master/app/models/project.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') + end +end + describe TreeController, "routing" do it "to #show" do get("/gitlabhq/tree/master/app/models/project.rb").should route_to('tree#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') @@ -435,12 +436,6 @@ end describe "pending routing" do before { pending } - describe "/:project_id/blob/:id" do - it "routes to a ref with a path" do - get("/gitlabhq/blob/master/app/models/project.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') - end - end - describe "/:project_id/commit/:id" do it "routes to a specific commit" do get("/gitlabhq/commit/f4b1449").should route_to('commit#show', project_id: 'gitlabhq', id: 'f4b1449') |