mirror of
https://github.com/kemko/paperclip.git
synced 2026-01-01 16:05:40 +03:00
Railtie test
This commit is contained in:
23
test/railtie_test.rb
Normal file
23
test/railtie_test.rb
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class RailtieTest < Test::Unit::TestCase
|
||||||
|
should "load processors" do
|
||||||
|
FileUtils.mkdir_p('tmp/rails/lib/paperclip_processors')
|
||||||
|
File.write(Rails.root.join('lib/paperclip_processors/some_custom_processor.rb'), <<~RUBY)
|
||||||
|
class Paperclip::SomeCustomProcessor < Paperclip::Processor
|
||||||
|
end
|
||||||
|
RUBY
|
||||||
|
Paperclip::Railtie.initializers.each(&:run)
|
||||||
|
assert defined?(Paperclip::SomeCustomProcessor)
|
||||||
|
end
|
||||||
|
|
||||||
|
should "load rake tasks" do
|
||||||
|
require 'rake'
|
||||||
|
require 'rake/testtask'
|
||||||
|
|
||||||
|
Rails.application.load_tasks
|
||||||
|
assert_equal Rake::Task, Rake.application["paperclip:refresh:thumbnails"].class
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -30,6 +30,7 @@ if ENV['COVERAGE']
|
|||||||
add_group "Libraries", "lib/"
|
add_group "Libraries", "lib/"
|
||||||
|
|
||||||
track_files "{lib}/**/*.rb"
|
track_files "{lib}/**/*.rb"
|
||||||
|
add_filter "lib/tasks/paperclip_tasks.rake" # TODO: вообще по-хорошема надо и его покрыть
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user