From 38492590cf30bae0f4817c610bc0237ccdea7c1a Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Mon, 25 Jan 2016 18:26:20 +0200 Subject: Introduce new welcome page for new projects As requested by David in 23233. --- .../images/getting_started/rails_welcome.png | Bin 142320 -> 1053549 bytes .../rails/templates/rails/welcome/index.html.erb | 326 ++++----------------- railties/test/application/routing_test.rb | 3 +- railties/test/isolation/abstract_unit.rb | 4 +- 4 files changed, 65 insertions(+), 268 deletions(-) diff --git a/guides/assets/images/getting_started/rails_welcome.png b/guides/assets/images/getting_started/rails_welcome.png index 4d0cb417b7..baccb11322 100644 Binary files a/guides/assets/images/getting_started/rails_welcome.png and b/guides/assets/images/getting_started/rails_welcome.png differ diff --git a/railties/lib/rails/templates/rails/welcome/index.html.erb b/railties/lib/rails/templates/rails/welcome/index.html.erb index acf04af416..5cdb7e6a20 100644 --- a/railties/lib/rails/templates/rails/welcome/index.html.erb +++ b/railties/lib/rails/templates/rails/welcome/index.html.erb @@ -1,268 +1,64 @@ - - Ruby on Rails: Welcome aboard - - - - -
- - -
- - - - -
-

Getting started

-

Here’s how to get rolling:

- -
    -
  1. -

    Use bin/rails generate to create your models and controllers

    -

    To see all available options, run it without parameters.

    -
  2. - -
  3. -

    Set up a root route to replace this page

    -

    You're seeing this page because you're running in development mode and you haven't set a root route yet.

    -

    Routes are set up in config/routes.rb.

    -
  4. - -
  5. -

    Configure your database

    -

    If you're not using SQLite (the default), edit config/database.yml with your username and password.

    -
  6. -
-
-
- - -
- + + Ruby on Rails + + + + + + +
+
+

+ + Ruby on Rails + +

+ +

Yay! You’re on Rails!

+ + Welcome + +

+ Rails version: <%= Rails.version %>
+ Ruby version: <%= RUBY_VERSION %> (<%= RUBY_PLATFORM %>) +

+
+
+ diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb index 0777714d35..e51f32aaed 100644 --- a/railties/test/application/routing_test.rb +++ b/railties/test/application/routing_test.rb @@ -42,8 +42,7 @@ module ApplicationTests test "root takes precedence over internal welcome controller" do app("development") - get '/' - assert_match %r{

Getting started

} , last_response.body + assert_welcome get('/') controller :foo, <<-RUBY class FooController < ApplicationController diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index df3c2ca66d..dddf8bd257 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -74,10 +74,12 @@ module TestHelpers end def assert_welcome(resp) + resp = Array(resp) + assert_equal 200, resp[0] assert_match 'text/html', resp[1]["Content-Type"] assert_match 'charset=utf-8', resp[1]["Content-Type"] - assert extract_body(resp).match(/Welcome aboard/) + assert extract_body(resp).match(/Yay! You.*re on Rails!/) end def assert_success(resp) -- cgit v1.2.3