Sha256: e3420b8a74ab4fbb5c4cbedaf72ca27010463c88f694061aa6aa9322117ff295

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

require 'spec_helper'

feature "user generates rails app without js test framework" do
  def app_name
    'dummy_rails'
  end

  def app_path
    join_paths(tmp_path, app_name)
  end

  before(:all) do
    make_it_so!("rails #{app_name} --js-test-lib false")
  end

  let(:package_json_path) { File.join(app_path, 'package.json') }

  it 'does not create a karma.config' do
    karma_config = File.join(app_path, 'karma.conf.js')
    expect(FileTest.exists?(karma_config)).to eq(false)
  end

  it 'does not create a testHelper.js' do
    test_helper = File.join(app_path, 'spec/javascript/testHelper.js')
    expect(FileTest.exists?(test_helper)).to eq(false)
  end

  it 'does not create an enzyme config file' do
    test_helper = File.join(app_path, 'spec/javascript/support/enzyme.js')
    expect(FileTest.exists?(test_helper)).to eq(false)
  end

  it 'does not include karma or jest in package.json' do
    in_package_json?(File.join(app_path, 'package.json')) do |json|
      expect(json["devDependencies"]["karma"]).to be_nil
      expect(json["devDependencies"]["jest"]).to be_nil
    end
  end

  it 'does not include jasmine in package.json' do
    in_package_json?(File.join(app_path, 'package.json')) do |json|
      expect(json["devDependencies"]["jasmine-core"]).to be_nil
    end
  end

  it 'does not add a test script in package.json' do
    in_package_json?(package_json_path) do |json|
      expect(json["scripts"]["test"]).to be_nil
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
make_it_so-0.6.0 spec/features/rails/user_generates_rails_without_js_test_lib_spec.rb
make_it_so-0.5.1 spec/features/rails/user_generates_rails_without_js_test_lib_spec.rb
make_it_so-0.5.0 spec/features/rails/user_generates_rails_without_js_test_lib_spec.rb