Sha256: 70f3259f34ab4ca301adcda5240fb5b18b1ea9b438092f2c934a866849ab8038
Contents?: true
Size: 1.15 KB
Versions: 16
Compression:
Stored size: 1.15 KB
Contents
require 'test_helper' class InstallGeneratorTest < Rails::Generators::TestCase tests AttachmentMagick::Generators::InstallGenerator destination File.expand_path("../../tmp", __FILE__) setup do prepare_destination create_route_file end test "Assert all files are properly created" do run_generator assert_file "public/javascripts/swfupload/handlers.js" assert_file "public/javascripts/swfupload/swfupload.js" assert_file "public/javascripts/swfupload/swfupload.swf" assert_file "public/stylesheets/swfupload.css" assert_file "public/stylesheets/attachment_magick.css" assert_file "config/routes.rb" do |route| assert_match /'attachment_magick\/images#create'/, route assert_match /'attachment_magick\/images#update_sortable'/, route assert_match /'attachment_magick\/images#destroy'/, route end end private def create_route_file mkdir File.join(InstallGeneratorTest.destination_root, 'config') copy_file File.join(InstallGeneratorTest.destination_root, '../../dummy/config/routes.rb'), File.join(InstallGeneratorTest.destination_root, 'config/routes.rb') end end
Version data entries
16 entries across 16 versions & 1 rubygems