Sha256: 7ff92573df5b357c48c5e106232871ebf5ecb10950bb9481ac6b3657b3521eb4
Contents?: true
Size: 789 Bytes
Versions: 8
Compression:
Stored size: 789 Bytes
Contents
require 'spec_helper' describe AngularSprinkles::ModelDecorator do let(:key) { 'key' } let(:object) { double } let(:attribute) { :a } let(:json_wrapper) { ->(key, attribute) { "#{key}+#{attribute}"} } let(:object_wrapper) { double } subject do described_class.new(key: key, object: object, json_wrapper: json_wrapper, object_wrapper: object_wrapper) end describe "#bind" do it "returns a binding object" do expect(object_wrapper).to receive(:new).with(key, attribute, json_wrapper) subject.bind(attribute) expect(object_wrapper).to receive(:new).with(key, nil, json_wrapper) subject.bind end end describe "#class" do it "delegates to the wrapped object" do expect(subject.class).to eq(object.class) end end end
Version data entries
8 entries across 8 versions & 1 rubygems