Exercise 8.5.1: Refactor app/views/sessions/new.html.erb to use 'form_tag' in place of 'form_for'

Note in particular the change in the structure of the 'params' hash
In practice, comment out all in SessionsController#create and insert one single line "render 'new'", then click signin to see the form params hash structure
Exercies 8.5.2: Add test methods using RSpec custom matcher & helper method
Further decouple the tests from implementation
Merge branch 'chapter8-exercise' into updating-users

Conflicts:
	spec/support/utilities.rb
Showing all users: A failing test that user index action is protected against un-signed-in users
Showing all users: Get the test pass by requiring a signed-in user for the index action
Showing all users: A failing test that the user index page should list all users
Showing all users: Implement the user index action

Pay attention to the name difference @users & @user
Showing all users: The user index view which iterates over users and wraps each one in an <li> tag
Now the tests are green
Showing all users: A failing test that for signed-in users, the menu bar should contain a link to user index page
Showing all users: Get the test pass by adding the named route to the menu bar
Sample users: Create 100 sample users using fake gem and custom rake task

Technique used:
We defined a new rake task under namespace 'db', see lib/tasks/sample_data.rake

Please run commands (prefix with 'bundle install' if you're not using RVM):
$ rake db:reset
$ rake db:populate
$ rake test:prepare
Pagination: Install the will_paginate gem and bootstrap-will_paginate gem
Pagination: A failing test that the user index page is paginated and page #1 should list each user of User.paginate(page:1)

Techiques:
1. Defining a Factory Girl sequence to create 30 users at testing easily
   30.times { FactoryGirl.create(:user) }
2. We test for a <div> with CSS class "pagination" which is what get output by will_paginate gem
   it { should have_selector('div.pagination') }
3. Use of before(:all), which ensures that the sample users are created once
   before(:all) { 30.times { FactoryGirl.create(:user) } }
   after(:all)  { User.delete_all }
   Note the contrast with before(:each)
4. The call to 'User.paginate(page:1)' instead of 'User.all' to retrieve data
Pagination: Use will_paginate to implement pagination and get tests all green

We introduce '<%= will_paginate %>' both above and below the user list, so it outputs paginator links both above and below
The '<%= will_paginate %>' will auto looks for an @users variable in a users view, and then displays paginator links to access other pages
It will also introduce a new parameter 'page' for implementation in the user index action
Partial refactoring: Replace the user <li> with a render call 'render user'

Note we call 'render' in view, so it's partials. But we don't pass a string with the name of the partial, we rather pass a user object. In such contect, Rails auto looks for a partial called _user.html.erb, which we must create
Partial refactoring: Replace <% @users.each do |user| %> <%= render user %> with <%= render @users %>