Sha256: 4fd584d20cfa40d1219c66295b4d0215f236e78b8c8377148ef5e6e688cd020a

Contents?: true

Size: 863 Bytes

Versions: 62

Compression:

Stored size: 863 Bytes

Contents

require 'test_helper'
require 'generators/workarea/seeds/seeds_generator'

module Workarea
  class SeedsGeneratorTest < GeneratorTest
    tests Workarea::SeedsGenerator
    destination Dir.mktmpdir

    setup do
      prepare_destination
      FileUtils.mkdir_p "#{destination_root}/config/initializers"
      File.open "#{destination_root}/config/initializers/workarea.rb", 'w' do |file|
        file.write "Workarea.configure do |config|\n\nend"
      end
    end

    def test_seeds
      run_generator %w(FeaturedProducts)

      assert_file 'app/seeds/workarea/featured_products_seeds.rb' do |creator|
        assert_match('class FeaturedProductsSeeds', creator)
      end

      assert_file 'config/initializers/workarea.rb' do |initializer|
        assert_match("config.seeds << 'Workarea::FeaturedProductsSeeds'", initializer)
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.5.26 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.4.45 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.5.25 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.5.23 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.4.44 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.5.22 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.4.43 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.5.21 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.4.42 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.5.20 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.4.41 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.5.19 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.4.40 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.5.18 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.4.39 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.5.17 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.4.38 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.5.16 test/generators/workarea/seeds_generator_test.rb
workarea-core-3.4.37 test/generators/workarea/seeds_generator_test.rb