diff --git a/spec/controllers/projects/git/git_trees_controller_spec.rb b/spec/controllers/projects/git/git_trees_controller_spec.rb index f2eb72079..eb73a0ed8 100644 --- a/spec/controllers/projects/git/git_trees_controller_spec.rb +++ b/spec/controllers/projects/git/git_trees_controller_spec.rb @@ -47,6 +47,11 @@ describe Projects::Git::TreesController do response.should_not be_success end + it 'should not be able to perform create action' do + post :create, @params.merge(:treeish => '', :from_ref => 'master', :new_ref => 'master-1') + response.should_not be_success + end + end context 'for other user' do @@ -80,6 +85,11 @@ describe Projects::Git::TreesController do response.should_not be_success end + it 'should not be able to perform create action' do + post :create, @params.merge(:treeish => '', :from_ref => 'master', :new_ref => 'master-1') + response.should_not be_success + end + [:tags, :branches].each do |action| it "should be able to perform #{action} action" do get action, @params.merge(:treeish => 'master') @@ -109,6 +119,11 @@ describe Projects::Git::TreesController do put :restore_branch, @params.merge(:treeish => 'conflicts') response.should be_success end + + it 'should be able to perform create action' do + post :create, @params.merge(:treeish => '', :from_ref => 'master', :new_ref => 'master-1') + response.should be_success + end end after(:all) {clean_projects_dir}