Sha256: c548087f4580798819ca832de88eeb24f41eee6e23c712870964e4abdee28155

Contents?: true

Size: 813 Bytes

Versions: 4

Compression:

Stored size: 813 Bytes

Contents

require 'spec_helper'

describe Grape::Entity::Exposure::RepresentExposure do
  subject(:exposure) { described_class.new(:foo, {}, {}, double, double) }

  describe '#setup' do
    subject { exposure.setup(using_class_name, subexposure) }

    let(:using_class_name) { double(:using_class_name) }
    let(:subexposure)      { double(:subexposure) }

    it 'sets using_class_name' do
      expect { subject }.to change { exposure.using_class_name }.to(using_class_name)
    end

    it 'sets subexposure' do
      expect { subject }.to change { exposure.subexposure }.to(subexposure)
    end

    context 'when using_class is set' do
      before do
        exposure.using_class
      end

      it 'resets using_class' do
        expect { subject }.to change { exposure.using_class }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
grape-entity-0.6.1 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.6.0 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.5.2 spec/grape_entity/exposure/represent_exposure_spec.rb
grape-entity-0.5.1 spec/grape_entity/exposure/represent_exposure_spec.rb