Rails-Summer-Project-Noah-and-Matt/Library-Application — pull request #132 by nbirnel (2014-09-03 04:01:33+00:00)
Title: add make a user an admin, closing (#26)

app/controllers/users_controller.rb
+ def adminify
app/models/user.rb
+ def adminify!
app/views/users/index.html.haml
+ %th= 'Admin?'
Don't check for admin, they are the only people who can hit this page
app/views/users/show.html.haml
+ %td= link_to 'Make Admin', adminify_useradmin_path(@user), class: 'btn btn-default'
config/routes.rb
+ get 'adminify'
get 'impersonate'
get 'stop_impersonating'
end
spec/features/make_admin_spec.rb
+ describe 'as an admin' do
+ it 'I can make another user an admin' do