Sha256: a673087b6c8662ae05e09024b9c8561b9019a7cb519be89ecd4657d10fde019d
Contents?: true
Size: 791 Bytes
Versions: 11
Compression:
Stored size: 791 Bytes
Contents
require 'spec_helper' # This is a bit of a insane spec I have to admit # Chosed the spree_payment_methods table because it has a `name` column # already. Stubs wouldn't work here (the delegation runs before this spec is # loaded) and adding a column here might make the test even crazy so here we go module Spree class DelegateBelongsToStubModel < Spree::Base self.table_name = "spree_payment_methods" belongs_to :product ActiveSupport::Deprecation.silence do delegate_belongs_to :product, :name end end describe DelegateBelongsToStubModel do context "model has column attr delegated to associated object" do it "doesnt touch the associated object" do expect(subject).not_to receive(:product) subject.name end end end end
Version data entries
11 entries across 11 versions & 1 rubygems