diff options
author | Sandro Santilli <strk@kbt.io> | 2018-01-07 14:10:20 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-01-07 15:10:20 +0200 |
commit | 44053532bb7c5b7fcd65fd5246780db8cf446f7e (patch) | |
tree | 421763fd45a3d50e3a6cd67d07bb563fddf35418 /integrations/pull_create_test.go | |
parent | 18bb0f8f1344771bbbc44fd37eee772c5c3b44d6 (diff) | |
download | gitea-44053532bb7c5b7fcd65fd5246780db8cf446f7e.tar.gz gitea-44053532bb7c5b7fcd65fd5246780db8cf446f7e.zip |
Serve .patch for pull requests (#3305)
* Serve .patch for pull requests
Closes #3259
Updates "git" module, for GetFormatPatch
* Handle io.Copy error
Diffstat (limited to 'integrations/pull_create_test.go')
-rw-r--r-- | integrations/pull_create_test.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/integrations/pull_create_test.go b/integrations/pull_create_test.go index 00a23a29e0..89abccf883 100644 --- a/integrations/pull_create_test.go +++ b/integrations/pull_create_test.go @@ -56,7 +56,15 @@ func TestPullCreate(t *testing.T) { // check .diff can be accessed and matches performed change req := NewRequest(t, "GET", url+".diff") resp = session.MakeRequest(t, req, http.StatusOK) - assert.Regexp(t, "\\+Hello, World \\(Edited\\)", resp.Body) + assert.Regexp(t, `\+Hello, World \(Edited\)`, resp.Body) assert.Regexp(t, "^diff", resp.Body) assert.NotRegexp(t, "diff.*diff", resp.Body) // not two diffs, just one + + // check .patch can be accessed and matches performed change + req = NewRequest(t, "GET", url+".patch") + resp = session.MakeRequest(t, req, http.StatusOK) + assert.Regexp(t, `\+Hello, World \(Edited\)`, resp.Body) + assert.Regexp(t, "diff", resp.Body) + assert.Regexp(t, `Subject: \[PATCH\] Update 'README.md'`, resp.Body) + assert.NotRegexp(t, "diff.*diff", resp.Body) // not two diffs, just one } |