the-city-admin 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. data/.autotest +9 -0
  2. data/.gitignore +4 -0
  3. data/.rspec +2 -0
  4. data/.rvmrc +1 -0
  5. data/.yardoc/checksums +50 -0
  6. data/.yardoc/object_types +0 -0
  7. data/.yardoc/objects/root.dat +0 -0
  8. data/.yardoc/proxy_types +0 -0
  9. data/Gemfile +11 -0
  10. data/Gemfile.lock +51 -0
  11. data/README +1 -0
  12. data/Rakefile +32 -0
  13. data/index.rb +123 -0
  14. data/lib/common.rb +163 -72
  15. data/lib/the_city_admin.rb +2 -2
  16. data/notes.txt +21 -0
  17. data/spec/api/address_list_spec.rb +0 -0
  18. data/spec/api/address_spec.rb +0 -0
  19. data/spec/api/group_address_list_spec.rb +93 -0
  20. data/spec/api/group_address_spec.rb +19 -0
  21. data/spec/api/group_checkin_list_spec.rb +93 -0
  22. data/spec/api/group_event_attendance_list_spec.rb +93 -0
  23. data/spec/api/group_export_spec.rb +19 -0
  24. data/spec/api/group_invitation_list_spec.rb +23 -0
  25. data/spec/api/group_invitation_spec.rb +19 -0
  26. data/spec/api/group_list_spec.rb +23 -0
  27. data/spec/api/group_role_list_spec.rb +23 -0
  28. data/spec/api/group_role_spec.rb +19 -0
  29. data/spec/api/group_spec.rb +19 -0
  30. data/spec/api/group_tag_list_spec.rb +23 -0
  31. data/spec/api/group_tag_spec.rb +19 -0
  32. data/spec/api/metric_list_spec.rb +22 -0
  33. data/spec/api/metric_measurement_list_spec.rb +23 -0
  34. data/spec/api/metric_measurement_spec.rb +19 -0
  35. data/spec/api/metric_spec.rb +19 -0
  36. data/spec/api/role_list_spec.rb +75 -0
  37. data/spec/api/role_spec.rb +19 -0
  38. data/spec/api/skill_list_spec.rb +76 -0
  39. data/spec/api/skilled_user_id_list_spec.rb +82 -0
  40. data/spec/api/skilled_user_list_spec.rb +82 -0
  41. data/spec/api/tag_group_list_spec.rb +72 -0
  42. data/spec/api/tag_list_spec.rb +77 -0
  43. data/spec/api/tag_spec.rb +19 -0
  44. data/spec/api/terminology_list_spec.rb +75 -0
  45. data/spec/api/terminology_spec.rb +19 -0
  46. data/spec/api/user_address_list_spec.rb +92 -0
  47. data/spec/api/user_address_spec.rb +19 -0
  48. data/spec/api/user_admin_privilege_list_spec.rb +94 -0
  49. data/spec/api/user_admin_privilege_spec.rb +19 -0
  50. data/spec/api/user_barcode_spec.rb +19 -0
  51. data/spec/api/user_family_list_spec.rb +91 -0
  52. data/spec/api/user_family_member_spec.rb +19 -0
  53. data/spec/api/user_invitation_list_spec.rb +91 -0
  54. data/spec/api/user_invitation_spec.rb +19 -0
  55. data/spec/api/user_list_spec.rb +76 -0
  56. data/spec/api/user_note_list_spec.rb +91 -0
  57. data/spec/api/user_note_spec.rb +19 -0
  58. data/spec/api/user_process_list_spec.rb +90 -0
  59. data/spec/api/user_process_spec.rb +19 -0
  60. data/spec/api/user_role_list_spec.rb +92 -0
  61. data/spec/api/user_role_spec.rb +18 -0
  62. data/spec/api/user_skill_list_spec.rb +91 -0
  63. data/spec/api/user_skill_spec.rb +19 -0
  64. data/spec/api/user_spec.rb +37 -0
  65. data/spec/api/web_hook_list_spec.rb +75 -0
  66. data/spec/api/web_hook_spec.rb +19 -0
  67. data/spec/factories/address.rb +21 -0
  68. data/spec/factories/address_list.rb +13 -0
  69. data/spec/factories/checkin.rb +35 -0
  70. data/spec/factories/checkin_list.rb +13 -0
  71. data/spec/factories/group.rb +30 -0
  72. data/spec/factories/group_address.rb +21 -0
  73. data/spec/factories/group_address_list.rb +13 -0
  74. data/spec/factories/group_checkin.rb +35 -0
  75. data/spec/factories/group_checkin_list.rb +13 -0
  76. data/spec/factories/group_event_attendance.rb +19 -0
  77. data/spec/factories/group_event_attendance_list.rb +13 -0
  78. data/spec/factories/group_export.rb +16 -0
  79. data/spec/factories/group_export_list.rb +13 -0
  80. data/spec/factories/group_role.rb +19 -0
  81. data/spec/factories/group_tag.rb +12 -0
  82. data/spec/factories/role.rb +22 -0
  83. data/spec/factories/role_list.rb +13 -0
  84. data/spec/factories/skill.rb +13 -0
  85. data/spec/factories/skill_list.rb +13 -0
  86. data/spec/factories/skilled_user_id_list.rb +13 -0
  87. data/spec/factories/skilled_user_list.rb +13 -0
  88. data/spec/factories/tag.rb +13 -0
  89. data/spec/factories/tag_group_list.rb +13 -0
  90. data/spec/factories/tag_list.rb +13 -0
  91. data/spec/factories/terminology.rb +10 -0
  92. data/spec/factories/terminology_list.rb +13 -0
  93. data/spec/factories/user.rb +51 -0
  94. data/spec/factories/user_address.rb +19 -0
  95. data/spec/factories/user_address_list.rb +13 -0
  96. data/spec/factories/user_admin_privilege.rb +11 -0
  97. data/spec/factories/user_admin_privilege_list.rb +13 -0
  98. data/spec/factories/user_barcode.rb +15 -0
  99. data/spec/factories/user_family_list.rb +13 -0
  100. data/spec/factories/user_family_member.rb +28 -0
  101. data/spec/factories/user_invitation.rb +16 -0
  102. data/spec/factories/user_invitation_list.rb +13 -0
  103. data/spec/factories/user_list.rb +13 -0
  104. data/spec/factories/user_note.rb +28 -0
  105. data/spec/factories/user_note_list.rb +13 -0
  106. data/spec/factories/user_process.rb +11 -0
  107. data/spec/factories/user_process_list.rb +13 -0
  108. data/spec/factories/user_role.rb +17 -0
  109. data/spec/factories/user_role_list.rb +13 -0
  110. data/spec/factories/user_skill.rb +10 -0
  111. data/spec/factories/user_skill_list.rb +13 -0
  112. data/spec/factories/web_hook.rb +12 -0
  113. data/spec/factories/web_hook_list.rb +13 -0
  114. data/spec/functional/the_city_admin_spec.rb +20 -0
  115. data/spec/readers/user_reader_spec.rb +7 -0
  116. data/spec/spec_helper.rb +31 -0
  117. data/spec/writers/skill_writer_spec.rb +0 -0
  118. data/spec/writers/tag_writer_spec.rb +80 -0
  119. data/spec/writers/user_writer_spec.rb +80 -0
  120. data/status.txt +187 -0
  121. data/test_scripts/addresses.rb +36 -0
  122. data/test_scripts/barcodes_checkins.rb +45 -0
  123. data/test_scripts/city_keys.rb +6 -0
  124. data/test_scripts/familes.rb +83 -0
  125. data/test_scripts/groups.rb +124 -0
  126. data/test_scripts/metrics.rb +72 -0
  127. data/test_scripts/roles.rb +94 -0
  128. data/test_scripts/skills.rb +55 -0
  129. data/test_scripts/tags.rb +71 -0
  130. data/test_scripts/terminology.rb +62 -0
  131. data/test_scripts/users.rb +325 -0
  132. data/test_scripts/webhooks.rb +57 -0
  133. data/thecity_admin_api.gemspec +39 -0
  134. data/thecity_headers.rb +27 -0
  135. metadata +238 -3
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :tag_group_list, :class => TheCity::TagGroupList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #groups {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :tag_list, :class => TheCity::TagList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #tags {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :terminology, :class => TheCity::Terminology do
5
+ term 'CG'
6
+ label 'Life'
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :terminology_list, :class => TheCity::TerminologyList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #labels {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,51 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user, :class => TheCity::User do
5
+ api_url "https://api.onthecity.org/users/946060874"
6
+ updated_at "05/15/2012 07:24 AM (UTC)"
7
+ last_logged_in "05/16/2012 04:52 AM (UTC)"
8
+ secondary_phone ""
9
+ last_engaged "05/16/2012 04:52 AM (UTC)"
10
+ title "Pastor"
11
+ internal_url "http://local.devthecity.org:3000/users/946060874"
12
+ id 946060874
13
+ first "Sam"
14
+ primary_campus_name nil
15
+ last "Shepherd"
16
+ head_of_household true
17
+ nickname "Sammy"
18
+ active true
19
+ primary_phone_type "home"
20
+ primary_phone ""
21
+ member_since "05/14/2012"
22
+ birthdate "1974-11-09"
23
+ email_bouncing false
24
+ secondary_phone_type "home"
25
+ primary_campus_id nil
26
+ marital_status nil
27
+ contact_updated_at "05/15/2012 12:24 AM (UTC)"
28
+ type "User"
29
+ staff true
30
+ admin_url "http://church.onthecity.org/admin/users/946060874"
31
+ created_at "05/14/2012 05:51 PM (UTC)"
32
+ gender "Male"
33
+ external_id_1 nil
34
+ external_id_2 nil
35
+ external_id_3 nil
36
+ middle ""
37
+ email "zack@church.org"
38
+ last_checkin_date "05/14/2012 05:51 PM (UTC)"
39
+ last_donation_date "05/14/2012 05:51 PM (UTC)"
40
+ last_attendance_date "05/14/2012 05:51 PM (UTC)"
41
+ in_community true
42
+ in_service true
43
+ in_welcome true
44
+ in_campus true
45
+ in_neighborhood true
46
+ end
47
+
48
+ end
49
+ end
50
+
51
+
@@ -0,0 +1,19 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_address, :class => TheCity::UserAddress do
5
+ city "Seattle"
6
+ created_at "04/30/2012 08:46 PM (UTC)"
7
+ latitude 47.64114
8
+ updated_at "04/30/2012 09:34 PM (UTC)"
9
+ zipcode "98109"
10
+ id 552561485
11
+ street "2547 32nd Ave W"
12
+ location_type "Home"
13
+ privacy "Private"
14
+ longitude -122.398326
15
+ state "WA"
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_address_list, :class => TheCity::UserAddressList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #addresses {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_admin_privilege, :class => TheCity::UserAdminPrivilege do
5
+ title "Designer"
6
+ user_id 452617
7
+ user "Dr. Third Eagle"
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_admin_privilege_list, :class => TheCity::UserAdminPrivilegeList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #account_roles {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_barcode, :class => TheCity::UserBarcode do
5
+ barcode "234234234"
6
+ id 1012338309
7
+ created_at "05/16/2012"
8
+ end
9
+
10
+ end
11
+ end
12
+
13
+
14
+
15
+
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_family_list, :class => TheCity::UserFamilyList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #family_members {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,28 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_family_member, :class => TheCity::UserFamilyMember do
5
+ name "Pastor Sam Shepherd"
6
+ admin_url "http://local.devthecity.org:3000/admin/users/946060874"
7
+ external_id_1 nil
8
+ birthdate "1974-11-09"
9
+ user_id 946060874
10
+ barcodes [{
11
+ :created_at => "04/30/2012",
12
+ :barcode => "0987654321"
13
+ }]
14
+ family_role "Spouse"
15
+ api_url "https://api.onthecity.org/users/946060874"
16
+ active true
17
+ email "zack@onthecity.org"
18
+ end
19
+
20
+ end
21
+ end
22
+
23
+
24
+
25
+
26
+
27
+
28
+
@@ -0,0 +1,16 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_invitation, :class => TheCity::UserInvitation do
5
+ created_at "02/06/2012"
6
+ pending_approval false
7
+ group_id 17543
8
+ id 1696876
9
+ user_id 14347
10
+ custom_message nil
11
+ source "API Invite | Group A (17543) on 2012-02-06 at 16:54"
12
+ email "theusers@email.net"
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_invitation_list, :class => TheCity::UserInvitationList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #invitations {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_list, :class => TheCity::UserList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #users {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,28 @@
1
+
2
+ module TheCity
3
+ FactoryGirl.define do
4
+
5
+ factory :user_note, :class => TheCity::UserNote do
6
+ created_at "05/08/2012"
7
+ body "Deaconship is complete"
8
+ author "Pastor Sam Shepherd"
9
+ updated_at "05/08/2012"
10
+ id 756434911
11
+ visible_to [
12
+ "Account Admin",
13
+ "User Admin"
14
+ ]
15
+ author_id 946060874
16
+ file_attachments [
17
+ {
18
+ :authenticated_s3_url => "https://aws....",
19
+ :filename => "list_of_sins.pdf"
20
+ }]
21
+ end
22
+
23
+ end
24
+ end
25
+
26
+
27
+
28
+
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_note_list, :class => TheCity::UserNoteList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #notes {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_process, :class => TheCity::UserProcess do
5
+ name "Member Process"
6
+ id 241832976
7
+ state "complete"
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_process_list, :class => TheCity::UserProcessList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #processes {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_role, :class => TheCity::UserRole do
5
+ group_name "The Group"
6
+ created_at "05/11/2009"
7
+ group_api_url "https://api.onthecity.org/admin/groups/1245"
8
+ title "Participant"
9
+ group_type "Campus"
10
+ group_id 1245
11
+ id 75530
12
+ last_engaged "01/24/2012"
13
+ active true
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_role_list, :class => TheCity::UserRoleList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #roles {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_skill, :class => TheCity::UserSkill do
5
+ name "Teaching-Curriculum"
6
+ skill_id 1046429013
7
+ end
8
+
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :user_skill_list, :class => TheCity::UserSkillList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #skills {}
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :web_hook, :class => TheCity::WebHook do
5
+ id 1
6
+ event 'create'
7
+ object 'User'
8
+ callback_uri 'https://mysite.com/user_create'
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ module TheCity
2
+ FactoryGirl.define do
3
+
4
+ factory :web_hook_list, :class => TheCity::WebHookList do
5
+ total_entries 0
6
+ total_pages 0
7
+ per_page 15
8
+ current_page 1
9
+ #web_hooks {}
10
+ end
11
+
12
+ end
13
+ end