#222: added specs for GitTree#create

This commit is contained in:
Vokhmin Alexey V 2013-07-22 16:13:07 +04:00
parent 6f67b580c4
commit 0c1334aef7
1 changed files with 15 additions and 0 deletions

View File

@ -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}