Sha256: 98a079bb3366bd26bd6e5863ea0f8475dde1ca6710ee3cb97d2b1df144601623

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe Arpa::Entities::Profile, type: :entity, fast: true do

  describe 'initializing' do

    describe 'setting default values' do

      context 'when pass some parameters as nil' do

        it 'attribute :role_ids should be an empty Array' do
          expect(subject.role_ids).to eq []
        end

        it 'attribute :role should be an empty Array' do
          expect(subject.roles).to eq []
        end

        it 'attribute :removed should be false' do
          expect(subject.removed).to be_falsey
        end
      end
    end

    context 'when pass some parameters as empty' do
      let(:attrs) { {role_ids: '', roles: '', removed: ''} }
      subject { Arpa::Entities::Profile.new attrs }

      it 'attribute :role_ids should be an empty Array' do
        expect(subject.role_ids).to eq []
      end

      it 'attribute :role should be an empty Array' do
        expect(subject.roles).to eq []
      end

      it 'attribute :removed should be false' do
        expect(subject.removed).to be_falsey
      end
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arpa-0.2.0 spec/lib/arpa/entities/profile_spec.rb
arpa-0.1.0 spec/lib/arpa/entities/profile_spec.rb
arpa-0.0.9 spec/lib/arpa/entities/profile_spec.rb
arpa-0.0.8 spec/lib/ar/entities/profile_spec.rb