Sha256: 56311e50433d5215950a2b4e47f6b31ebe79f5c2d071b511cc5adc3a1fb0ccdc
Contents?: true
Size: 989 Bytes
Versions: 4
Compression:
Stored size: 989 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' require 'uploadcare/rails/active_record/mount_uploadcare_file' require 'uploadcare/rails/active_record/mount_uploadcare_file_group' describe Uploadcare::Rails::ActiveRecord::MountUploadcareFile do before do allow(Uploadcare::Rails).to receive(:configuration).and_return(OpenStruct.new) stub_const 'Post', Class.new Post.class_eval do include Uploadcare::Rails::ActiveRecord::MountUploadcareFile extend ActiveModel::Callbacks define_model_callbacks :save, only: :after def initialize @picture = '' end mount_uploadcare_file :picture end end context 'when checking mount file methods availability' do it 'checks that a model instance responds to mount file methods', :aggregate_failures do post = Post.new %i[uploadcare_store_picture! uploadcare_delete_picture!].each do |method| expect(post).to respond_to(method) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems