Commit e8e70dfd37ce3da61fdfeb6fc4149b7355e2fb61

Authored by Ryan Jones
1 parent d9de2210
Exists in master and in 1 other branch production

add new files

app/models/notification_service.rb 0 → 100644
... ... @@ -0,0 +1,25 @@
  1 +class NotificationService
  2 + include Mongoid::Document
  3 +
  4 + field :room_id, :type => String
  5 + field :api_token, :type => String
  6 + field :subdomain, :type => String
  7 +
  8 + validate :check_params
  9 +
  10 + # Subclasses are responsible for overwriting this method.
  11 + def check_params; true; end
  12 +
  13 + def notification_description(problem)
  14 + "[#{ problem.environment }][#{ problem.where }] #{problem.message.to_s.truncate(100)}"
  15 + end
  16 +
  17 + # Allows us to set the issue tracker class from a single form.
  18 + def type; self._type; end
  19 + def type=(t); self._type=t; end
  20 +
  21 + # Retrieve tracker label from either class or instance.
  22 + Label = ''
  23 + def self.label; self::Label; end
  24 + def label; self.class.label; end
  25 +end
... ...
spec/fabricators/notification_fabricator.rb 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +Fabricator(:notification) do
  2 + name "MyString"
  3 +end
... ...
spec/models/notification_spec.rb 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +require 'spec_helper'
  2 +
  3 +describe Notification do
  4 + pending "add some examples to (or delete) #{__FILE__}"
  5 +end
... ...