Sha256: 7af04c87b4f27055cd995daa44eb55cba92f539011778fc8c39c1b96d00ccc01
Contents?: true
Size: 836 Bytes
Versions: 14
Compression:
Stored size: 836 Bytes
Contents
require "spec_helper" describe Mongoid::Relations::Proxy do describe "#extend" do before(:all) do Person.reset_callbacks(:validate) module Testable end end after(:all) do Object.send(:remove_const, :Testable) end let(:person) do Person.create end let(:name) do person.build_name end before do name.namable.extend(Testable) end it "extends the proxied object" do expect(person).to be_a(Testable) end context "when extending from the relation definition" do let!(:address) do person.addresses.create(street: "hobrecht") end let(:found) do person.addresses.find_by_street("hobrecht") end it "extends the proxy" do expect(found).to eq(address) end end end end
Version data entries
14 entries across 14 versions & 5 rubygems