Skip to content

Commit

Permalink
Fix admin user creation
Browse files Browse the repository at this point in the history
  • Loading branch information
mwean committed May 21, 2014
1 parent 38e7da4 commit fcf5647
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/admin/admin_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
f.inputs 'User' do
f.input :email
f.input :password
f.input :password_confirmation
f.input :password_confirmation, required: true
end
f.actions
end

controller do
def permitted_params
params.permit admin_user: [:email, :password, :password_confirmation]
params.permit(user: [:email, :password, :password_confirmation])
end
end
end
14 changes: 14 additions & 0 deletions spec/features/admin_users_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'spec_helper'

feature 'creating a user' do
scenario 'user creates a new admin user' do
log_in_admin_user
visit new_admin_user_path
fill_in 'Email', with: '[email protected]'
find('#user_password_confirmation').set('password')
find('#user_password').set('password')
find('input[type="submit"]').click

expect(current_path).to eq(admin_user_path(AdminUser.find_by(email: '[email protected]')))
end
end

0 comments on commit fcf5647

Please sign in to comment.