Sha256: 6afb94ee0897c1ad52cd30425f0c1617f26a152f9c46fe24cfc83e632d1488a2

Contents?: true

Size: 524 Bytes

Versions: 2

Compression:

Stored size: 524 Bytes

Contents

require 'test_helper'

class DecoratorTest < MiniTest::Spec


  describe "Decorator" do
    it "exposes ::prepare" do
      require 'representable/version'
      if Representable::VERSION.split(".")[1] == "4"
        require 'roar/decorator'

        class SongRepresentation < Roar::Decorator
          include Roar::Representer::JSON

          property :name
        end

        SongRepresentation.prepare(OpenStruct.new(:name => "Not The Same")).to_hash.must_equal({"name"=>"Not The Same"})
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roar-0.11.15 test/decorator_test.rb
roar-0.11.14 test/decorator_test.rb