Sha256: 3ef0018aa36c1b0f4db7a9d76c458483d1d3eed378a8fc7436aa9768fc0cf2b8

Contents?: true

Size: 597 Bytes

Versions: 1

Compression:

Stored size: 597 Bytes

Contents

module ModelPresenter
  module Spec
    module Macros
      def as_json_attributes(*keys)
        describe "#as_json" do
          let(:result) { presenter.as_json }
          keys.each do |key|
            context "having the key #{key}"
            it "has the key #{key} with value set to presenter.#{key}" do
              if result[key].respond_to?(:should)
                expect(result[key]).to eq(presenter.send(key))
              else
                expect(result[key]).to eq(presenter.send(key))
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
model_presenter-0.1.3 spec/support/macros/as_json.rb