[ARVADOS] updated: 6ea2e62b70a015226c4f3361ab3591509100a820

git at public.curoverse.com git at public.curoverse.com
Tue Apr 8 23:32:11 EDT 2014


Summary of changes:
 services/api/test/unit/user_test.rb |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

       via  6ea2e62b70a015226c4f3361ab3591509100a820 (commit)
      from  e4b0ff638bb41ce55ab3770c4f2b7f744d653aac (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 6ea2e62b70a015226c4f3361ab3591509100a820
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Apr 8 23:32:27 2014 -0400

    Fix tests: make sure system_user exists before making "pre-test users" list

diff --git a/services/api/test/unit/user_test.rb b/services/api/test/unit/user_test.rb
index 9f78b1a..16c05a7 100644
--- a/services/api/test/unit/user_test.rb
+++ b/services/api/test/unit/user_test.rb
@@ -1,13 +1,19 @@
 require 'test_helper'
 
 class UserTest < ActiveSupport::TestCase
+  include CurrentApiClient
 
   # The fixture services/api/test/fixtures/users.yml serves as the input for this test case
   setup do
+    # Make sure system_user exists before making "pre-test users" list
+    system_user
+
     @all_users = User.find(:all)
 
     @all_users.each do |user|
-      if user.is_admin && user.is_active
+      if user.uuid == system_user_uuid
+        @system_user = user
+      elsif user.is_admin && user.is_active
         @admin_user = user
       elsif user.is_active && !user.is_admin
         @active_user = user
@@ -89,7 +95,7 @@ class UserTest < ActiveSupport::TestCase
     user.save
 
     # verify there is one extra user in the db now
-    assert (User.find(:all).size == @all_users.size+1)
+    assert_equal @all_users.size+1, User.find(:all).size
 
     user = User.find(user.id)   # get the user back
     assert_equal(user.first_name, 'first_name_for_newly_created_user')

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list