Add diff format to commit#show

This commit is contained in:
Riyad Preukschas 2012-11-22 20:49:44 +01:00
parent 246faa3d7a
commit 3b7c2adf0a
2 changed files with 2 additions and 0 deletions

View file

@ -26,6 +26,7 @@ class CommitController < ProjectResourceController
end
end
format.diff { render text: @commit.to_diff }
format.patch { render text: @commit.to_patch }
end
end

View file

@ -285,6 +285,7 @@ end
describe CommitController, "routing" do
it "to #show" do
get("/gitlabhq/commit/4246fb").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb')
get("/gitlabhq/commit/4246fb.diff").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'diff')
get("/gitlabhq/commit/4246fb.patch").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'patch')
get("/gitlabhq/commit/4246fbd13872934f72a8fd0d6fb1317b47b59cb5").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fbd13872934f72a8fd0d6fb1317b47b59cb5')
end