Sha256: 882ea6be1f69e0e41b52612938e42335c09f8b5544435b2f4fa3e6cfb75cc065

Contents?: true

Size: 976 Bytes

Versions: 17

Compression:

Stored size: 976 Bytes

Contents

require 'test_helper'
require 'generators/adminpanel/gallery/gallery_generator'

class GalleryGeneratorTest < Rails::Generators::TestCase
  tests Adminpanel::GalleryGenerator
  destination Rails.root.join('tmp/generators')
  setup :prepare_destination

  def test_the_generation_of_the_productfiles_migration
    run_generator ['Product']
    assert_migration(
      'db/migrate/create_adminpanel_productfiles.rb',
      /t.integer :product_id/,
      /create_table :adminpanel_productfiles/
    )
  end

  def test_the_generation_of_the_productfile
    run_generator ['Product']
    assert_file(
      'app/models/adminpanel/productfile.rb',
      /mount_uploader :file, ProductfileUploader/
    )
  end

  def test_the_generation_of_the_productfile_uploader
    run_generator ['Product']
    assert_file(
      'app/uploaders/adminpanel/productfile_uploader.rb'
    )
  end

  def test_runs_without_errors
    assert_nothing_raised do
      run_generator
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
adminpanel-2.4.3 test/generators/gallery_generator_test.rb
adminpanel-2.4.2 test/generators/gallery_generator_test.rb
adminpanel-2.4.1 test/generators/gallery_generator_test.rb
adminpanel-2.4.0 test/generators/gallery_generator_test.rb
adminpanel-2.3.1 test/generators/gallery_generator_test.rb
adminpanel-2.3.0 test/generators/gallery_generator_test.rb
adminpanel-2.2.5 test/generators/gallery_generator_test.rb
adminpanel-2.2.4 test/generators/gallery_generator_test.rb
adminpanel-2.2.3 test/generators/gallery_generator_test.rb
adminpanel-2.2.2 test/generators/gallery_generator_test.rb
adminpanel-2.2.1 test/generators/gallery_generator_test.rb
adminpanel-2.2.0 test/generators/gallery_generator_test.rb
adminpanel-2.1.7 test/generators/gallery_generator_test.rb
adminpanel-2.1.6 test/generators/gallery_generator_test.rb
adminpanel-2.1.5 test/generators/gallery_generator_test.rb
adminpanel-2.1.3 test/generators/gallery_generator_test.rb
adminpanel-2.1.2 test/generators/gallery_generator_test.rb