Write specs for tag based build. Refs #103

This commit is contained in:
Pavel Chipiga 2012-01-17 14:25:54 +02:00
parent a687a6601b
commit b5170e2f2a
1 changed files with 11 additions and 1 deletions

View File

@ -36,9 +36,19 @@ describe BuildListsController do
it 'should be able to perform create action' do
post :create, {:project_id => @project.id}.merge(@create_params)
@project.build_lists.last.commit_hash.should == @project.git_repository.commits.last.id
response.should redirect_to(@project)
end
it 'should save correct commit_hash for branch based build' do
post :create, {:project_id => @project.id}.merge(@create_params).deep_merge(:build_list => {:project_version => "master_latest"})
@project.build_lists.last.commit_hash.should == @project.git_repository.commits('master').last.id
end
it 'should save correct commit_hash for tag based build' do
system("cd #{@project.git_repository.path} && git tag -a -m '4.7.5.3' 4.7.5.3") # TODO REDO through grit
post :create, {:project_id => @project.id}.merge(@create_params).deep_merge(:build_list => {:project_version => "4.7.5.3"})
@project.build_lists.last.commit_hash.should == @project.git_repository.commits('4.7.5.3').last.id
end
end
shared_examples_for 'not create build list' do