Merge branch 'rails_3_1' of github.com:locomotivecms/engine into rails_3_1

This commit is contained in:
did 2011-12-08 07:48:11 -08:00
commit bbf0b0e083

View File

@ -145,26 +145,26 @@ describe Locomotive::ContentInstance do
@content_type.api_enabled = true
@content_type.api_accounts = ['', @account_1.id, @account_2.id]
Site.any_instance.stubs(:accounts).returns([@account_1, @account_2])
Locomotive::Site.any_instance.stubs(:accounts).returns([@account_1, @account_2])
@content = build_content
end
it 'does not send email notifications if the api is disabled' do
@content_type.api_enabled = false
Admin::Notifications.expects(:new_content_instance).never
Locomotive::Notifications.expects(:new_content_instance).never
@content.save
end
it 'does not send email notifications if no api accounts' do
@content_type.api_accounts = nil
Admin::Notifications.expects(:new_content_instance).never
Locomotive::Notifications.expects(:new_content_instance).never
@content.save
end
it 'sends email notifications when a new instance is created' do
Admin::Notifications.expects(:new_content_instance).with(@account_1, @content).returns(mock('mailer', :deliver => true))
Admin::Notifications.expects(:new_content_instance).with(@account_2, @content).returns(mock('mailer', :deliver => true))
Locomotive::Notifications.expects(:new_content_instance).with(@account_1, @content).returns(mock('mailer', :deliver => true))
Locomotive::Notifications.expects(:new_content_instance).with(@account_2, @content).returns(mock('mailer', :deliver => true))
@content.save
end