Test mail delivery after copy

pull/1432/head
Hagen Schink 11 years ago
parent b82d13f4d4
commit 336000992a
  1. 23
      spec/controllers/copy_projects_controller_spec.rb

@ -100,4 +100,27 @@ describe CopyProjectsController do
it_should_behave_like "a controller action which needs project permissions" it_should_behave_like "a controller action which needs project permissions"
end end
describe 'copy sends eMail' do
context 'on success' do
it 'user receives success mail' do
UserMailer.should_receive(:project_copy_succeeded)
copy_project(project)
end
end
context 'on error' do
before do
UserMailer.stub(:with_deliveries).and_raise(ActiveRecord::RecordNotFound)
end
it 'user receives success mail' do
UserMailer.should_receive(:project_copy_failed)
copy_project(project)
end
end
end
end end

Loading…
Cancel
Save