Sha256: 9f5ac53a1f519fa1cc844a03f007e61ebb961cff1161ee20d59675ccd64e43c2

Contents?: true

Size: 920 Bytes

Versions: 4

Compression:

Stored size: 920 Bytes

Contents

require 'test_helper'

class InvitationTest < ActiveSupport::TestCase
  fixtures :invitations, :users, :roles

  def test_email_addresses_validation
    addresses = "valid@example.com, valid_2@example.com, invalid.invalid.com"
    invitation = Invitation.new(:email_addresses => addresses)
    assert !invitation.valid?
    assert invitation.errors[:email_addresses]
  end
  
  def test_send_with_names_in_emails
    addresses = '"Valid Example" <valid@example.com>, valid_2@example.com'
    invitation = Invitation.new(:email_addresses => addresses)
    invitation.user = users(:quentin)
    assert invitation.valid?
    assert invitation.send_invite    
  end
  
  def test_send_invite
    addresses = "valid@example.com, valid_2@example.com"
    invitation = Invitation.new(:email_addresses => addresses)
    invitation.user = users(:quentin)
    assert invitation.valid?
    assert invitation.send_invite
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
community_engine-3.2.0 test/unit/invitation_test.rb
community_engine-3.0.0 test/unit/invitation_test.rb
community_engine-2.3.2 test/unit/invitation_test.rb
community_engine-2.3.1 test/unit/invitation_test.rb