Sha256: a4e85d9ad3c98982f424dac4ea18a2eeb6e3dcfc921a7dd6e46b68b911aa23da

Contents?: true

Size: 1.04 KB

Versions: 10

Compression:

Stored size: 1.04 KB

Contents

require 'test_helper'

class SimpleFormGeneratorTest < Rails::Generators::TestCase
  tests SimpleForm::Generators::InstallGenerator
  destination File.expand_path('../../tmp', __FILE__)
  setup :prepare_destination
  teardown { rm_rf(destination_root) }

  test 'generates example locale file' do
    run_generator
    assert_file 'config/locales/simple_form.en.yml'
  end

  test 'generates the simple_form initializer' do
    run_generator
    assert_file 'config/initializers/simple_form.rb',
      /config\.default_wrapper = :default/, /config\.boolean_style = :nested/
  end

  test 'generates the simple_form initializer with the bootstrap wrappers' do
    run_generator %w(--bootstrap)
    assert_file 'config/initializers/simple_form.rb', /config\.wrappers :bootstrap/,
      /config\.default_wrapper = :bootstrap/
  end

  %W(erb haml slim).each do |engine|
    test "generates the scaffold template when using #{engine}" do
      run_generator ['-e', engine]
      assert_file "lib/templates/#{engine}/scaffold/_form.html.#{engine}"
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/test/generators/simple_form_generator_test.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/test/generators/simple_form_generator_test.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/test/generators/simple_form_generator_test.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/test/generators/simple_form_generator_test.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/simple_form-2.0.2/test/generators/simple_form_generator_test.rb
simple_form-2.0.2 test/generators/simple_form_generator_test.rb
ehoch_simple_form-2.0.2.dev test/generators/simple_form_generator_test.rb
simple_form-2.0.1 test/generators/simple_form_generator_test.rb
simple_form-2.0.0 test/generators/simple_form_generator_test.rb
simple_form-2.0.0.rc test/generators/simple_form_generator_test.rb