Sha256: 2ca116c5954f6331e56220375d60132801401c5cfa0d91d6d78aae2c22ff13cb

Contents?: true

Size: 489 Bytes

Versions: 10

Compression:

Stored size: 489 Bytes

Contents

# frozen_string_literal: true

describe Azeroth::Decorator do
  subject(:decorator) { DummyModel::Decorator.new(object) }

  let(:object) do
    DummyModel.new(
      id: 100,
      first_name: 'John',
      last_name: 'Wick',
      favorite_pokemon: 'Arcanine'
    )
  end

  describe '#as_json' do
    it 'returns exposed attributes' do
      expect(decorator.as_json).to eq(
        'name' => 'John Wick',
        'age' => nil,
        'pokemon' => 'Arcanine'
      )
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
azeroth-0.6.3 spec/integration/yard/azeroth/decorator_spec.rb
azeroth-0.6.2 spec/integration/yard/azeroth/decorator_spec.rb
azeroth-0.6.1 spec/integration/yard/azeroth/decorator_spec.rb
azeroth-0.6.0 spec/integration/yard/azeroth/decorator_spec.rb
azeroth-0.5.0 spec/integration/yard/azeroth/decorator_spec.rb
azeroth-0.4.0 spec/integration/yard/azeroth/decorator_spec.rb
azeroth-0.3.0 spec/integration/yard/azeroth/decorator_spec.rb
azeroth-0.2.0 spec/integration/yard/azeroth/decorator_spec.rb
azeroth-0.1.0 spec/integration/yard/azeroth/decorator_spec.rb
azeroth-0.0.7 spec/integration/yard/azeroth/decorator_spec.rb