In my model, I run the method redefine_associations! during execution:
# frozen_string_literal: true
class MyModule < AnotherModule
redefine_associations!
end
class AnotherModule < ApplicationRecord
def self.redefine_associations!
belongs_to :user
end
redefine_associations!
end
How can I test that my model has redefine_associations!.
I tried the following which did not work:
# frozen_string_literal: true
RSpec.MyModule VisitDate do
it { expect(subject).to have_received(:redefine_associations!) }
it { should respond_to(:redefine_associations!) }
end