SCENARIO
I have extracted a concern called Taggable. It\'s a module that allows any model to support tagging. I have included
Here is my solution of similar problem:
describe Taggable do
subject { mock_model('User').send(:extend, Taggable) }
it { should have_many(:tags) }
...
describe "#tag" do
...
end
end
In fact mock_model('User') can mock any existent model in the system.
This is not an ideal solution but at least it's clear and mocks everything.
Note: mock_model (AR mocks) were extracted to rspec-activemodel-mocks in rspec 3.0.
Also you need to use shoulda-matchers for associations matchers.