diff options
author | Martin Cabrera <martin@kisland.com> | 2017-01-10 23:46:32 +0100 |
---|---|---|
committer | Martin Cabrera <martin@kisland.com> | 2017-01-10 23:46:32 +0100 |
commit | 6972a35fec05d08f2d243622d68d064105026398 (patch) | |
tree | 688af2914093f30fe2876b247ecec364abad0bb0 | |
parent | 5dc8fe31ba19f321041d2ad5c73765062d41a312 (diff) | |
download | gitlab-ce-6972a35fec05d08f2d243622d68d064105026398.tar.gz |
Added specs for branches compare when from & to are empty
-rw-r--r-- | spec/controllers/projects/compare_controller_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/controllers/projects/compare_controller_spec.rb b/spec/controllers/projects/compare_controller_spec.rb index 7a57801c437..c4905937878 100644 --- a/spec/controllers/projects/compare_controller_spec.rb +++ b/spec/controllers/projects/compare_controller_spec.rb @@ -64,6 +64,16 @@ describe Projects::CompareController do expect(assigns(:diffs)).to eq(nil) expect(assigns(:commits)).to eq(nil) end + + it 'redirects back to index when params[:from] & params[:to] are empty' do + post(:create, + namespace_id: project.namespace.to_param, + project_id: project.to_param, + from: '', + to: '') + + expect(response).to redirect_to(namespace_project_compare_index_path) + end end describe 'GET diff_for_path' do |