Small namespace fixes to specs.

This commit is contained in:
Mario Visic 2011-12-08 23:36:53 +08:00
parent b60b1378f8
commit 1c139af4e0

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