From 0c1334aef7d1c6fdd4246fdcd715cdf5b1f3543a Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Mon, 22 Jul 2013 16:13:07 +0400 Subject: [PATCH] #222: added specs for GitTree#create --- .../projects/git/git_trees_controller_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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}