Skip to content

Commit

Permalink
update user creation to create\!
Browse files Browse the repository at this point in the history
  • Loading branch information
John Williams committed Apr 21, 2011
1 parent 2a449ad commit 81a2061
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/tasks/user.rake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace :user do
user_name = ui.ask("User name: ")
password = ui.ask("Password: ")

user = User.create(:name => name, :email => email,
user = User.create!(:name => name, :email => email,
:user_name => user_name, :password => password)

puts "User `#{user_name}' created: ##{user.id}"
Expand Down
2 changes: 1 addition & 1 deletion test/unit/user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class UserTest < ActiveSupport::TestCase

test "creating new user with duplicate user name should fail" do
begin
subscriptions(:john).users.create(:name => "James Johnson",
subscriptions(:john).users.create!(:name => "James Johnson",
:email => "[email protected]", :user_name => "jjohnson",
:password => "ponies!")
rescue ActiveRecord::RecordInvalid => error
Expand Down

0 comments on commit 81a2061

Please sign in to comment.