describe Symphonia::Attachment do context 'files' do let(:file) { FactoryBot.create(:file) } it '#create' do expect { file }.to change(described_class, :count).by 1 end it 'just create common file' do f = nil expect { f = FactoryBot.create(:file, attachable: nil) }.to change(described_class, :count).by 1 expect(f.attachable).to be_nil end end context 'images' do let(:image) { FactoryBot.create(:image) } it '#create' do expect { image }.to change(described_class, :count).by 1 end end end