Sha256: 23a3e12fc1f0fdfe27862cf71e5d2db2b91862c81a1636b67cd11e133f479ed8
Contents?: true
Size: 874 Bytes
Versions: 1
Compression:
Stored size: 874 Bytes
Contents
require "spec_helper" describe Protobuf::ActiveRecord::NestedAttributes do let(:user_message) { UserMessage.new(name: "foo bar", email: "foo@test.co", photos: [{url: "https://test.co/test.png"}]) } describe "._filter_attribute_fields", aggregate_failures: true do it "includes nested attributes" do attribute_fields = User._filter_attribute_fields(user_message) expect(attribute_fields[:photos_attributes]).to eq(user_message.photos) end context "when" do end end describe ".new" do context "when a model accepts nested attributes" do it "transforms nested attributes", aggregate_failures: true do user_message.photos.each do |photo_message| expect(Photo).to receive(:attributes_from_proto).with(photo_message).and_call_original end User.new(user_message) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
protobuf-activerecord-7.0.0 | spec/protobuf/active_record/nested_attributes_spec.rb |