Sha256: 7bc324a5dba327a4cf379f39a94259e4ca5d18ab8c2612b0f259c0269f977329

Contents?: true

Size: 541 Bytes

Versions: 5

Compression:

Stored size: 541 Bytes

Contents

require 'test_helper'

class NoticeTest < ActiveSupport::TestCase
  def test_should_be_valid
    User.as :admin do
      assert Notice.create(:global => true, :content => "hello", :level => "warning").valid?
    end
  end

  def test_should_attach_to_everyone
    notice = Notice.create(:global => false, :content => "hello", :level => "message")
    assert User.count == notice.users.count
  end

  def test_should_reject_incorrect_level
    assert Notice.create(:global => true, :content => "hello", :level => "bogus").invalid?
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/test/unit/notice_test.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/test/unit/notice_test.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/test/unit/notice_test.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/test/unit/notice_test.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/test/unit/notice_test.rb