Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-12-01 11:30:39 +0300
committerStan Hu <stanhu@gmail.com>2015-12-01 11:30:39 +0300
commita518879a6fe606630b225ccfc4f489b3b0d58adf (patch)
tree3ae854327c49b7ec3814288a1509aa998772f873 /spec
parentceeb93fa77783a3fa9a60529195cd187af191bba (diff)
parent8c4a3c77d87e89bf3fd237fef49fc87fb6170d86 (diff)
Merge pull request #9868 from yms9654/commit-without-whitespace
Add ignore whitespace change option to commit view
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/commit_controller_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/controllers/commit_controller_spec.rb b/spec/controllers/commit_controller_spec.rb
index bb3d87f3840..5337a69e84b 100644
--- a/spec/controllers/commit_controller_spec.rb
+++ b/spec/controllers/commit_controller_spec.rb
@@ -69,6 +69,21 @@ describe Projects::CommitController do
expect(response.body).to start_with("diff --git")
end
+
+ it "should really only be a git diff without whitespace changes" do
+ get(:show,
+ namespace_id: project.namespace.to_param,
+ project_id: project.to_param,
+ id: '66eceea0db202bb39c4e445e8ca28689645366c5',
+ # id: commit.id,
+ format: format,
+ w: 1)
+
+ expect(response.body).to start_with("diff --git")
+ # without whitespace option, there are more than 2 diff_splits
+ diff_splits = assigns(:diffs)[0].diff.split("\n")
+ expect(diff_splits.length).to be <= 2
+ end
end
describe "as patch" do