require 'cf_spec_helper'

describe 'Rails 5.1 (Webpack/Yarn) App' do
  subject(:app) do
    Machete.deploy_app(app_name)
  end
  let(:browser) { Machete::Browser.new(app) }

  after do
    Machete::CF::DeleteApp.new.execute(app)
  end

  context 'in an online environment' do
    let(:app_name) { 'rails51' }

    specify do
      expect(app).to be_running
      expect(app).to have_logged /Downloaded.*node-6\./

      browser.visit_path('/')
      expect(browser).to have_body('Hello World')
      expect(app).to have_logged /Started GET "\/" for/
    end
  end
end

require 'cf_spec_helper'

describe 'Rails 5.1 (Webpack/Yarn) App' do
  let(:buildpack) { ENV.fetch('SHARED_HOST')=='true' ? 'ruby_buildpack' : 'ruby-test-buildpack' }
  subject(:app) do
    Machete.deploy_app(app_name, buildpack: buildpack)
  end
  let(:browser) { Machete::Browser.new(app) }

  after do
    Machete::CF::DeleteApp.new.execute(app)
  end

  context 'in an online environment' do
    let(:app_name) { 'rails51' }

    specify do
      expect(app).to be_running
      expect(app).to have_logged /Downloaded.*node-6\./

      browser.visit_path('/')
      expect(browser).to have_body('Hello World')
      expect(app).to have_logged /Started GET "\/" for/
    end
  end
end

Revert "Revert "Make sure rails51 uses ruby buildpack""
Revert "Revert "Make sure rails51 uses ruby buildpack""

The buildpack order on our shared cf-deployment environment is
alphabetical:

binary_buildpack        1          true      false
dotnet_core_buildpack   2          true      false
go_buildpack            3          true      false
java_buildpack          4          true      false
nodejs_buildpack        5          true      false
python_buildpack        6          true      false
php_buildpack           7          true      false
ruby_buildpack          8          true      false
staticfile_buildpack    9          true      false

So for now, we still need this

This reverts commit dad6cf7f93a874dc2ac8b2d70af3a0f3db46c8a3.

Signed-off-by: Nikita Rathi <c9767bf2fec5c766a4bbec0247a4fe5653c411cf@pivotal.io>
