Add tests for notification case

pull/3125/head
Alexander Bach 10 years ago committed by Jens Ulferts
parent c9e7caf3e5
commit b9416c22c4
  1. 9
      spec/requests/api/v3/work_packages/work_packages_by_project_resource_spec.rb

@ -66,10 +66,17 @@ describe API::V3::WorkPackages::WorkPackagesByProjectAPI, type: :request do
let(:path) { "#{api_v3_paths.work_packages_by_project(project.id)}?notify=false" }
it 'should not send a mail' do
post path, parameters.to_json, 'CONTENT_TYPE' => 'application/json'
expect(ActionMailer::Base.deliveries.count).to eq(0)
end
end
context 'with notifications' do
let(:path) { "#{api_v3_paths.work_packages_by_project(project.id)}?notify=true" }
it 'should not send a mail' do
expect(ActionMailer::Base.deliveries.count).to eq(1)
end
end
end
it 'should return Created(201)' do

Loading…
Cancel
Save