diff --git a/spec/controllers/api/v1/build_lists_controller_spec.rb b/spec/controllers/api/v1/build_lists_controller_spec.rb index df5c5d01c..53ddd5fef 100644 --- a/spec/controllers/api/v1/build_lists_controller_spec.rb +++ b/spec/controllers/api/v1/build_lists_controller_spec.rb @@ -51,6 +51,18 @@ shared_examples_for 'create build list via api' do it 'should not create without existing commit hash in project' do lambda{ post :create, @create_params.deep_merge(build_list: {commit_hash: 'wrong'})}.should change{@project.build_lists.count}.by(0) end + + it 'should not create without existing arch' do + lambda{ post :create, @create_params.deep_merge(build_list: {arch_id: -1})}.should change{@project.build_lists.count}.by(0) + end + + it 'should not create without existing save_to_platform' do + lambda{ post :create, @create_params.deep_merge(build_list: {save_to_platform_id: -1})}.should change{@project.build_lists.count}.by(0) + end + + it 'should not create without existing save_to_repository' do + lambda{ post :create, @create_params.deep_merge(build_list: {save_to_repository_id: -1})}.should change{@project.build_lists.count}.by(0) + end end shared_examples_for 'not create build list via api' do diff --git a/spec/controllers/api/v1/projects_controller_spec.rb b/spec/controllers/api/v1/projects_controller_spec.rb index 06dcaa8ec..1fe487702 100644 --- a/spec/controllers/api/v1/projects_controller_spec.rb +++ b/spec/controllers/api/v1/projects_controller_spec.rb @@ -120,6 +120,10 @@ shared_examples_for 'api projects user with admin rights' do get :members, id: @project.id, format: :json response.should be_success end + it 'should not set a wrong maintainer_id' do + put :update, project: { maintainer_id: -1 }, id: @project.id, format: :json + response.should_not be_success + end context 'api project user with update rights' do before do @@ -129,7 +133,7 @@ shared_examples_for 'api projects user with admin rights' do it 'should be able to perform update action' do response.should be_success end - it 'ensures that group has been updated' do + it 'ensures that description has been updated' do @project.reload @project.description.should == 'new description' end