Administrative users: A failing tests for an 'admin' attribute & 'admin?' boolean method
Administrative users: Add admin attribute to user model with a migration
'rails generate migration add_admin_to_users admin:boolean'
Administrative users: Set default value of 'admin' to false
Administrative users: Migrate users table and get all tests pass (method 'admin?' is auto generated by Rails)

$ bundle exec rake db:migrate
$ bundle exec rake test:prepare
Administrative users: Update sample data populator to make the first user admin

Remember to run commands
$ bundle exec rake db:reset
$ bundle exec rake db:populate
$ bundle exec rake test:prepare
Deleting users: Enable us to use 'FactoryGirl.create(:admin)' to create an admin user in our tests
Deleting users: Add failing tests for delete links

Normal user should not see the delete links
Admin should see the delete links but cannot delete himself
Admin clicks on 'delete' will delete the user

Techniques:
'match: :first' means we don't care on which user we click 'delete'
Deleting users: Add delete links to _user partial (viewable only by admins)

Technique:
'method: :delete' parameter means the link will issue DELETE request (though Rails fakes it with javascript because browsers can't send DELETE request natively. If JS is not enabled by client, you have to fake it using a form and a POST request with some 'DELETE' in the form data, see http://railscasts.com/episodes/77-destroy-without-javascript)
Deleting users: Adding a working destroy action and get the tests all green

Pay attention: There's still a big security hole in the app, because we only use 'if/else' in views to ensure that only admin users could see the delete links, but we don't prevent client issuing 'DELETE' request to URL e.g./users/1
We have to do it in users controller
Deleting users: A failing test that non-admin will be redirect to root_url if issuing DELETE to /users/<id>
Deleting users: Add a before filter to ensure only admins could issue DELETE to /users/<id>

All tests green now