Skip to content

Commit

Permalink
Notify users about notable Lifecycle events
Browse files Browse the repository at this point in the history
Also remove previous events that were introduced for testing purposes.
  • Loading branch information
isimluk committed Oct 4, 2016
1 parent 8080782 commit 4bab161
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
37 changes: 31 additions & 6 deletions db/fixtures/notification_types.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
---
- :name: vm_powered_off
:message: Virtual Machine %{subject} has been powered off
:expires_in: 24.hours
- :name: host_provisioned
:message: Host %{subject} has been provisioned.
:expires_in: 7.days
:level: :success
:audience: tenant
- :name: vm_powered_on
:message: Virtual Machine %{subject} has been powered on
:expires_in: 24.hours
- :name: service_provisioned
:message: Service %{subject} has been provisioned.
:expires_in: 7.days
:level: :success
:audience: tenant
- :name: service_retired
:message: Service %{subject} has been retired.
:expires_in: 7.days
:level: :success
:audience: tenant
- :name: vm_provisioned
:message: Virtual Machine %{subject} has been provisioned.
:expires_in: 7.days
:level: :success
:audience: tenant
- :name: vm_retired
:message: Virtual Machine %{subject} has been retired.
:expires_in: 7.days
:level: :success
:audience: tenant
- :name: request_approved
:message: Request %{subject} has been approved.
:expires_in: 14.days
:level: :success
:audience: tenant
- :name: request_denied
:message: Request %{subject} has been denied.
:expires_in: 14.days
:level: :warning
:audience: tenant
2 changes: 1 addition & 1 deletion spec/models/notification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
describe '.emit' do
context 'successful' do
let(:vm) { FactoryGirl.create(:vm, :tenant => tenant) }
let(:notification_type) { :vm_powered_on }
let(:notification_type) { :vm_provisioned }

subject { Notification.create(:type => notification_type, :subject => vm) }

Expand Down

0 comments on commit 4bab161

Please sign in to comment.