From 1cfaea1eb323d58417fc91211c585dc012a2a37b Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Sun, 15 May 2011 16:55:37 -0700 Subject: [PATCH] Update fixtures --- test/fixtures/users.yml | 6 +++--- test/functional/sessions_controller_test.rb | 2 +- test/functional/users_controller_test.rb | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index a8f3659..966c684 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -1,8 +1,8 @@ --- -user: - name: User +erik: + name: Erik Michaels-Ober organization: Code for America - email: user@example.com + email: erik@example.com voice_number: 1234567890 sms_number: 1234567890 encrypted_password: "$2a$10$KF/JMZ494ZLhWLgHZeBTf.cSL4l0Wjij4gIZP7BzkueAC1p4nW0ma" diff --git a/test/functional/sessions_controller_test.rb b/test/functional/sessions_controller_test.rb index 6a1b230..e0bc04c 100644 --- a/test/functional/sessions_controller_test.rb +++ b/test/functional/sessions_controller_test.rb @@ -4,7 +4,7 @@ class SessionsControllerTest < ActionController::TestCase include Devise::TestHelpers setup do request.env["devise.mapping"] = Devise.mappings[:user] - @user = users(:user) + @user = users(:erik) end test 'should render combo form' do diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index d37d675..228ddd6 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -4,7 +4,7 @@ class UsersControllerTest < ActionController::TestCase include Devise::TestHelpers setup do request.env["devise.mapping"] = Devise.mappings[:user] - @user = users(:user) + @user = users(:erik) end test 'should render info window' do @@ -35,27 +35,27 @@ class UsersControllerTest < ActionController::TestCase test 'should update user if password is correct' do sign_in @user - assert_not_equal @user.name, 'Erik Michaels-Ober' - put :update, :user => {:name => 'Erik Michaels-Ober', :current_password => 'correct'} + assert_not_equal @user.name, 'New Name' + put :update, :user => {:name => 'New Name', :current_password => 'correct'} @user.reload - assert_equal @user.name, 'Erik Michaels-Ober' + assert_equal @user.name, 'New Name' assert_response :redirect assert_redirected_to :controller => 'hydrants', :action => 'show' end test 'should return error if password is incorrect' do sign_in @user - put :update, :user => {:name => 'Erik Michaels-Ober', :current_password => 'incorrect'} + put :update, :user => {:name => 'New Name', :current_password => 'incorrect'} assert_response :error end test 'should create user if information is valid' do - post :create, :user => {:email => 'user1@example.com', :name => @user.name, :password => 'correct', :password_confirmation => 'correct'} + post :create, :user => {:email => 'user@example.com', :name => 'User', :password => 'correct', :password_confirmation => 'correct'} assert_response :success end test 'should return error if information is invalid' do - post :create, :user => {:email => 'user2@example.com', :name => @user.name, :password => 'correct', :password_confirmation => 'incorrect'} + post :create, :user => {:email => 'user@example.com', :name => 'User', :password => 'correct', :password_confirmation => 'incorrect'} assert_response :error end end