Sha256: 3270194644baab4426ab13a14f973601a039dadb5bbf6aec6d904aca2ee3c2c4

Contents?: true

Size: 989 Bytes

Versions: 7

Compression:

Stored size: 989 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 ['Testname']
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
adminpanel-2.6.0 test/generators/gallery_generator_test.rb
adminpanel-2.5.5 test/generators/gallery_generator_test.rb
adminpanel-2.5.4 test/generators/gallery_generator_test.rb
adminpanel-2.5.3 test/generators/gallery_generator_test.rb
adminpanel-2.5.2 test/generators/gallery_generator_test.rb
adminpanel-2.5.1 test/generators/gallery_generator_test.rb
adminpanel-2.5.0 test/generators/gallery_generator_test.rb