Sha256: 668a8b5813f1ca28933df4e3dbf778cc57ddfaac94597abf1f649e89250bd3dc

Contents?: true

Size: 984 Bytes

Versions: 19

Compression:

Stored size: 984 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_file(
      'app/models/adminpanel/productfile.rb',
      /mount_uploader :file, ProductfileUploader/
    )
    assert_file(
      'app/uploaders/adminpanel/productfile_uploader.rb'
    )
  end

  def test_the_generation_of_the_snake_cases_migration
    run_generator ['snake_case']
    assert_file(
      'app/models/adminpanel/snake_casefile.rb',
      /mount_uploader :file, SnakeCasefileUploader/
    )
    assert_file(
      'app/uploaders/adminpanel/snake_casefile_uploader.rb',
      /class SnakeCase/
    )
  end

  def test_runs_without_errors
    assert_nothing_raised do
      run_generator ['Testname']
    end
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
adminpanel-3.6.1 test/generators/gallery_generator_test.rb
adminpanel-3.6.0 test/generators/gallery_generator_test.rb
adminpanel-3.5.1 test/generators/gallery_generator_test.rb
adminpanel-3.5.0 test/generators/gallery_generator_test.rb
adminpanel-3.4.7 test/generators/gallery_generator_test.rb
adminpanel-3.4.6 test/generators/gallery_generator_test.rb
adminpanel-3.4.5 test/generators/gallery_generator_test.rb
adminpanel-3.4.4 test/generators/gallery_generator_test.rb
adminpanel-3.4.3 test/generators/gallery_generator_test.rb
adminpanel-3.4.2 test/generators/gallery_generator_test.rb
adminpanel-3.4.1 test/generators/gallery_generator_test.rb
adminpanel-3.4.0 test/generators/gallery_generator_test.rb
adminpanel-3.3.4 test/generators/gallery_generator_test.rb
adminpanel-3.3.3 test/generators/gallery_generator_test.rb
adminpanel-3.3.0 test/generators/gallery_generator_test.rb
adminpanel-3.2.1 test/generators/gallery_generator_test.rb
adminpanel-3.2.0 test/generators/gallery_generator_test.rb
adminpanel-3.1.0 test/generators/gallery_generator_test.rb
adminpanel-3.0.0 test/generators/gallery_generator_test.rb