Creating microposts: rails generate integration_test micropost_pages
Creating microposts: Add failing tests that signed-in user could create micropost at home page (root path)
Creating microposts: The Microposts controller create action

Note we applied strong parameters via 'micropost_params'
Creating microposts: Adding microposts creation to the Home page (/)

Note we serve two different pages for the signed-in and non-signed-in user
Creating microposts: Create the 'user_info' partial & 'micropost_form' partial used in home page

Also refactor the 'error_messages' partial

Techniques:
  <%= form_for(@micropost) do |f| %>
    <%= render 'shared/error_messages', object: f.object %>
    ...
  <% end %>
In 'error_messages' partial previous to this commit, we references the @user variable explicitly:
  <div class="alert alert-error">
    The form contains <%= pluralize(@user.errors.count, "error") %>.
  </div>
  <ul>
  <% @user.errors.full_messages.each do |msg| %>
    <li>* <%= msg %></li>
  <% end %>
  </ul>
Problem is in 'micropost_form' partial, we have no @user. Instead we have @micropost (though it's yet not defined in StaticPagesController). To enable the 'error_messages' partial to work with both object, we access the associated object of form variable 'f' by using 'f.object'. So that in:
  form_for(@user) do |f|
f.object is @user, and in:
  form_for(@micropost) do |f|
f.object is @micropost

Thus we also need to change the variable '@user' to 'object' in 'error_messages' partial, and those existing views or partials that are using the 'error_messages' partial.
Creating microposts: Get the tests passed by defining @microposts variable in StaticPagesController