diff options
author | Minsik Yoon <yms9654@gmail.com> | 2015-10-22 09:55:35 +0900 |
---|---|---|
committer | 윤민식 <minsik.yoon@samsung.com> | 2015-11-13 16:53:53 +0900 |
commit | 3d0efa8e0a359c84485a0fd7a3317745bf5648b8 (patch) | |
tree | 6bcc5739a8bba9a1bea8d787f687a56f3f919bb3 /spec/controllers/projects/compare_controller_spec.rb | |
parent | 23ed732e39d4e40e9a8643c015fd167b1e654470 (diff) | |
download | gitlab-ce-3d0efa8e0a359c84485a0fd7a3317745bf5648b8.tar.gz |
Add ignore white space option in merge request diff
fix this issue(https://gitlab.com/gitlab-org/gitlab-ce/issues/1393).
Add ignore whitespace optoin to Commits Compare view
Diffstat (limited to 'spec/controllers/projects/compare_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/compare_controller_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/controllers/projects/compare_controller_spec.rb b/spec/controllers/projects/compare_controller_spec.rb index 2a447248b70..be19f1abc53 100644 --- a/spec/controllers/projects/compare_controller_spec.rb +++ b/spec/controllers/projects/compare_controller_spec.rb @@ -23,6 +23,22 @@ describe Projects::CompareController do expect(assigns(:commits).length).to be >= 1 end + it 'compare should show some diffs with ignore whitespace change option' do + get(:show, + namespace_id: project.namespace.to_param, + project_id: project.to_param, + from: '08f22f25', + to: '66eceea0', + w: 1) + + expect(response).to be_success + expect(assigns(:diffs).length).to be >= 1 + expect(assigns(:commits).length).to be >= 1 + # 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 + describe 'non-existent refs' do it 'invalid source ref' do get(:show, |