Sha256: 4f27af332e210bef153e9f23984c2bb2e578595a9ae4650dc5a17ec4091f4ce4

Contents?: true

Size: 919 Bytes

Versions: 25

Compression:

Stored size: 919 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Pupa::Membership do
  let :object do
    Pupa::Membership.new({
      label: "Kitchen assistant at Joe's Diner",
      person_id: 'john-q-public',
      organization_id: 'abc-inc',
      post_id: 'abc-inc-kitchen-assistant',
      end_date: '1971-12-31',
    })
  end

  describe '#to_s' do
    it 'should return a human-readable string' do
      object.to_s.should == 'john-q-public in abc-inc'
    end
  end

  describe '#fingerprint' do
    it 'should return the fingerprint' do
      object.fingerprint.should == {
        '$or' => [
          {label: "Kitchen assistant at Joe's Diner", person_id: 'john-q-public', organization_id: 'abc-inc', end_date: '1971-12-31'},
          {person_id: 'john-q-public', organization_id: 'abc-inc', post_id: 'abc-inc-kitchen-assistant', end_date: '1971-12-31'},
        ],
      }
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
pupa-0.1.11 spec/models/membership_spec.rb
pupa-0.1.10 spec/models/membership_spec.rb
pupa-0.1.9 spec/models/membership_spec.rb
pupa-0.1.8 spec/models/membership_spec.rb
pupa-0.1.7 spec/models/membership_spec.rb
pupa-0.1.6 spec/models/membership_spec.rb
pupa-0.1.5 spec/models/membership_spec.rb
pupa-0.1.4 spec/models/membership_spec.rb
pupa-0.1.3 spec/models/membership_spec.rb
pupa-0.1.2 spec/models/membership_spec.rb
pupa-0.1.1 spec/models/membership_spec.rb
pupa-0.1.0 spec/models/membership_spec.rb
pupa-0.0.13 spec/models/membership_spec.rb
pupa-0.0.12 spec/models/membership_spec.rb
pupa-0.0.11 spec/models/membership_spec.rb
pupa-0.0.10 spec/models/membership_spec.rb
pupa-0.0.9 spec/models/membership_spec.rb
pupa-0.0.8 spec/models/membership_spec.rb
pupa-0.0.7 spec/models/membership_spec.rb
pupa-0.0.6 spec/models/membership_spec.rb