medivo 0.1.24 → 0.1.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/app/assets/javascripts/medivo/lab_appointment/handlers.coffee +19 -0
  2. data/app/controllers/medivo/labs_controller.rb +0 -1
  3. data/app/models/medivo/resource_config.rb +1 -1
  4. data/lib/medivo/version.rb +1 -1
  5. data/spec/dummy/app/controllers/labs_controller.rb +1 -0
  6. data/spec/dummy/log/development.log +2419 -0
  7. data/spec/dummy/log/test.log +212 -0
  8. data/spec/dummy/tmp/cache/assets/C46/F00/sprockets%2F2281d588b540056c5a7306c32a3761b9 +0 -0
  9. data/spec/dummy/tmp/cache/assets/C6C/8D0/sprockets%2F2f423a28516973330a94ad121151f3bf +0 -0
  10. data/spec/dummy/tmp/cache/assets/C81/D00/sprockets%2F64f056bd752d271308a86a6f865b1911 +0 -0
  11. data/spec/dummy/tmp/cache/assets/CB4/BD0/sprockets%2F3378f27c0d4f5e6d708665b22707a31f +0 -0
  12. data/spec/dummy/tmp/cache/assets/CC3/EF0/sprockets%2F453b504c1f8f374578636f699eaa455d +0 -0
  13. data/spec/dummy/tmp/cache/assets/CD8/DA0/sprockets%2F622aa5281d15503829a5f7a0bf56fc29 +0 -0
  14. data/spec/dummy/tmp/cache/assets/CDD/820/sprockets%2Fb28231960c7ac62eff9048e702a29c70 +0 -0
  15. data/spec/dummy/tmp/cache/assets/CEC/EF0/sprockets%2F4b24a74018f693c06088bd52f8cc9f86 +0 -0
  16. data/spec/dummy/tmp/cache/assets/CEE/250/sprockets%2F96688f33f2f8aa261bf6701c1d6d7575 +0 -0
  17. data/spec/dummy/tmp/cache/assets/D07/6B0/sprockets%2F69a2df619ff14da071309dac4196400e +0 -0
  18. data/spec/dummy/tmp/cache/assets/D1B/820/sprockets%2F92a83e15913997b3d9ac7ed437b1e44c +0 -0
  19. data/spec/dummy/tmp/cache/assets/D20/F10/sprockets%2Fb2e907e4faa85fe755f4439e3b229088 +0 -0
  20. data/spec/dummy/tmp/cache/assets/D29/000/sprockets%2F61a10ddf57f1129c02a1049bfed6e007 +0 -0
  21. data/spec/dummy/tmp/cache/assets/D2C/F80/sprockets%2F399f6d5eb273936af7ff8f35a77c5037 +0 -0
  22. data/spec/dummy/tmp/cache/assets/D30/920/sprockets%2Fcc4603fc6441ca421a7d02886a81ab9d +0 -0
  23. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  24. data/spec/dummy/tmp/cache/assets/D36/870/sprockets%2Fce9e887568de873b133ae43d7c977f68 +0 -0
  25. data/spec/dummy/tmp/cache/assets/D41/250/sprockets%2F7b3c4426715dcd1feedc4a95e5444256 +0 -0
  26. data/spec/dummy/tmp/cache/assets/D45/320/sprockets%2Fc50ff379a1bdf1dd4d22249058749cf6 +0 -0
  27. data/spec/dummy/tmp/cache/assets/D4C/7A0/sprockets%2Fbc635c7b186d1ef5178f4ed3722d868b +0 -0
  28. data/spec/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
  29. data/spec/dummy/tmp/cache/assets/D55/ED0/sprockets%2F0f673e42e816c6fe5b66a5c96f896f1a +0 -0
  30. data/spec/dummy/tmp/cache/assets/D5D/3E0/sprockets%2F63fea6cc142b5f02da93bf81e70b2116 +0 -0
  31. data/spec/dummy/tmp/cache/assets/D60/030/sprockets%2Ffc9485f617fc5e9b8918755d2e08ecc6 +0 -0
  32. data/spec/dummy/tmp/cache/assets/D64/C50/sprockets%2F22ee6fb2ab1ea9694ac7f0f41a406094 +0 -0
  33. data/spec/dummy/tmp/cache/assets/D65/6D0/sprockets%2F3ce07ca1958d7ab3e80c4b3e0d24088c +0 -0
  34. data/spec/dummy/tmp/cache/assets/D69/130/sprockets%2Fbaa4ec50a34ce938c986612c2a47a64e +0 -0
  35. data/spec/dummy/tmp/cache/assets/D74/9A0/sprockets%2F0ca4e6e833c72156fc7e7d5f007d9ce3 +0 -0
  36. data/spec/dummy/tmp/cache/assets/D76/720/sprockets%2F88d8aa1d2fb41ce79b8ec4150ea74748 +0 -0
  37. data/spec/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
  38. data/spec/dummy/tmp/cache/assets/D88/2C0/sprockets%2F452ab3ebb1912cf1c2ba617eec52a718 +0 -0
  39. data/spec/dummy/tmp/cache/assets/D9C/F50/sprockets%2F224e78bb9e1c414a2d518a3aaffd6f77 +0 -0
  40. data/spec/dummy/tmp/cache/assets/D9F/260/sprockets%2Fa3e040f83c30e4bbc1c79ffae57909e6 +0 -0
  41. data/spec/dummy/tmp/cache/assets/DA1/640/sprockets%2F91874cbba5e63cd19d6a7bd3c8362dc4 +0 -0
  42. data/spec/dummy/tmp/cache/assets/DC1/230/sprockets%2F3a36cd467bdce1914a2b7af4ed4114cf +0 -0
  43. data/spec/dummy/tmp/cache/assets/DCE/E80/sprockets%2Fc71ec62157b9cc7aabfc030955cef87b +0 -0
  44. data/spec/dummy/tmp/cache/assets/DD1/FD0/sprockets%2Fa531f33dc9c5852d39d64a9eda44dacf +0 -0
  45. data/spec/dummy/tmp/cache/assets/DD4/2B0/sprockets%2Fef214a63f29afe7f3cbffc65af943108 +0 -0
  46. data/spec/dummy/tmp/cache/assets/DFC/420/sprockets%2F502e2c683d1aaad6ac88966ffc4d2ade +0 -0
  47. data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  48. data/spec/dummy/tmp/cache/assets/E32/FC0/sprockets%2Fe55fb2eef11567fe04fdaf7e73af5ba4 +0 -0
  49. data/spec/models/appointment_spec.rb +20 -7
  50. data/spec/requests/labs_spec.rb +23 -0
  51. data/spec/support/helper.rb +12 -2
  52. metadata +19 -21
  53. data/spec/dummy/tmp/pids/server.pid +0 -1
@@ -991,3 +991,215 @@ Served asset /medivo/markerB.png - 200 OK (1ms)
991
991
 
992
992
  Started GET "/assets/medivo/arrow.png" for 127.0.0.1 at 2011-11-09 10:17:22 -0500
993
993
  Served asset /medivo/arrow.png - 200 OK (2ms)
994
+ Processing by OrdersController#download_requisition as HTML
995
+ Rendered text template (0.0ms)
996
+ Sent data unitedhealthcare_requisition.pdf (71.8ms)
997
+ Completed 200 OK in 903ms (Views: 70.9ms)
998
+ Processing by OrdersController#download_result as HTML
999
+ Sent data unitedhealthcare_result.pdf (2.3ms)
1000
+ Completed 200 OK in 729ms (Views: 1.5ms)
1001
+
1002
+
1003
+ Started GET "/medivo/labs/lab_data?zip_code=90210" for 127.0.0.1 at 2011-11-09 13:50:51 -0500
1004
+ Processing by Medivo::LabsController#lab_data as HTML
1005
+ Parameters: {"zip_code"=>"90210"}
1006
+ Completed 200 OK in 277ms (Views: 1.2ms)
1007
+
1008
+
1009
+ Started GET "/labs/lab_search?zip_code=90210" for 127.0.0.1 at 2011-11-09 13:50:54 -0500
1010
+ Processing by LabsController#lab_search as HTML
1011
+ Parameters: {"zip_code"=>"90210"}
1012
+ Completed 200 OK in 251ms (Views: 34.2ms)
1013
+
1014
+
1015
+ Started GET "/assets/application.css" for 127.0.0.1 at 2011-11-09 13:50:54 -0500
1016
+ Served asset /application.css - 200 OK (3ms)
1017
+
1018
+
1019
+ Started GET "/assets/application.js" for 127.0.0.1 at 2011-11-09 13:50:54 -0500
1020
+ Compiled medivo/lab_appointment/handlers.js (179ms) (pid 11418)
1021
+ Compiled medivo/lab_appointment/application.js (13ms) (pid 11418)
1022
+ Compiled application.js (10ms) (pid 11418)
1023
+ Served asset /application.js - 200 OK (241ms)
1024
+
1025
+
1026
+ Started GET "/assets/medivo/markerA.png" for 127.0.0.1 at 2011-11-09 13:50:55 -0500
1027
+ Served asset /medivo/markerA.png - 200 OK (3ms)
1028
+
1029
+
1030
+ Started GET "/assets/medivo/markerB.png" for 127.0.0.1 at 2011-11-09 13:50:55 -0500
1031
+ Served asset /medivo/markerB.png - 200 OK (2ms)
1032
+
1033
+
1034
+ Started GET "/assets/medivo/arrow.png" for 127.0.0.1 at 2011-11-09 13:50:55 -0500
1035
+ Served asset /medivo/arrow.png - 200 OK (2ms)
1036
+
1037
+
1038
+ Started GET "/medivo/labs/appointment_data" for 127.0.0.1 at 2011-11-09 14:59:08 -0500
1039
+ Processing by Medivo::LabsController#appointment_data as HTML
1040
+ Completed 500 Internal Server Error in 1ms (Views: 0.3ms)
1041
+
1042
+
1043
+ Started GET "/medivo/labs/appointment_data" for 127.0.0.1 at 2011-11-09 15:01:31 -0500
1044
+ Processing by Medivo::LabsController#appointment_data as HTML
1045
+ Completed 500 Internal Server Error in 1ms (Views: 0.3ms)
1046
+
1047
+
1048
+ Started GET "/medivo/labs/appointment_data" for 127.0.0.1 at 2011-11-09 15:02:15 -0500
1049
+ Processing by Medivo::LabsController#appointment_data as HTML
1050
+ Completed 500 Internal Server Error in 1ms (Views: 0.2ms)
1051
+
1052
+
1053
+ Started GET "/medivo/labs/appointment_data" for 127.0.0.1 at 2011-11-09 15:02:27 -0500
1054
+ Processing by Medivo::LabsController#appointment_data as HTML
1055
+ Completed 500 Internal Server Error in 1ms (Views: 0.4ms)
1056
+
1057
+
1058
+ Started GET "/medivo/labs/appointment_data?date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:06:33 -0500
1059
+ Processing by Medivo::LabsController#appointment_data as HTML
1060
+ Parameters: {"date"=>"11/01/2011", "lab_code"=>"20060"}
1061
+ Completed 500 Internal Server Error in 1ms (Views: 0.5ms)
1062
+
1063
+
1064
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:06:47 -0500
1065
+ Processing by Medivo::LabsController#appointment_data as HTML
1066
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1067
+ Completed 500 Internal Server Error in 2ms (Views: 0.6ms)
1068
+
1069
+
1070
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:08:57 -0500
1071
+ Processing by Medivo::LabsController#appointment_data as HTML
1072
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1073
+ Completed 500 Internal Server Error in 2ms (Views: 0.5ms)
1074
+
1075
+
1076
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:09:22 -0500
1077
+ Processing by Medivo::LabsController#appointment_data as HTML
1078
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1079
+ Completed 500 Internal Server Error in 1ms (Views: 0.5ms)
1080
+
1081
+
1082
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:09:34 -0500
1083
+ Processing by Medivo::LabsController#appointment_data as HTML
1084
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1085
+ Completed 500 Internal Server Error in 1ms (Views: 0.5ms)
1086
+
1087
+
1088
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:10:18 -0500
1089
+ Processing by Medivo::LabsController#appointment_data as HTML
1090
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1091
+ Completed 500 Internal Server Error in 1ms (Views: 0.5ms)
1092
+
1093
+
1094
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:10:20 -0500
1095
+ Processing by Medivo::LabsController#appointment_data as HTML
1096
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1097
+ Completed 500 Internal Server Error in 1ms (Views: 0.5ms)
1098
+
1099
+
1100
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:10:25 -0500
1101
+ Processing by Medivo::LabsController#appointment_data as HTML
1102
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1103
+ Completed 500 Internal Server Error in 2ms (Views: 0.6ms)
1104
+
1105
+
1106
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:10:27 -0500
1107
+ Processing by Medivo::LabsController#appointment_data as HTML
1108
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1109
+ Completed 500 Internal Server Error in 2ms (Views: 0.5ms)
1110
+
1111
+
1112
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:13:28 -0500
1113
+ Processing by Medivo::LabsController#appointment_data as HTML
1114
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1115
+ Completed 500 Internal Server Error in 2ms (Views: 0.5ms)
1116
+
1117
+
1118
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:14:14 -0500
1119
+ Processing by Medivo::LabsController#appointment_data as HTML
1120
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1121
+ Completed 500 Internal Server Error in 3ms (Views: 0.7ms)
1122
+
1123
+
1124
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:14:28 -0500
1125
+ Processing by Medivo::LabsController#appointment_data as HTML
1126
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1127
+ Completed 200 OK in 2ms (Views: 0.5ms)
1128
+
1129
+
1130
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:14:40 -0500
1131
+ Processing by Medivo::LabsController#appointment_data as HTML
1132
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1133
+ Completed 200 OK in 2ms (Views: 0.5ms)
1134
+
1135
+
1136
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:14:50 -0500
1137
+ Processing by Medivo::LabsController#appointment_data as HTML
1138
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1139
+ Completed 200 OK in 2ms (Views: 0.5ms)
1140
+
1141
+
1142
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:14:56 -0500
1143
+ Processing by Medivo::LabsController#appointment_data as HTML
1144
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1145
+ Completed 200 OK in 1ms (Views: 0.5ms)
1146
+
1147
+
1148
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:16:46 -0500
1149
+ Processing by Medivo::LabsController#appointment_data as HTML
1150
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1151
+ Completed 200 OK in 1ms (Views: 0.6ms)
1152
+
1153
+
1154
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:16:58 -0500
1155
+ Processing by Medivo::LabsController#appointment_data as HTML
1156
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1157
+ Completed 200 OK in 1ms (Views: 0.5ms)
1158
+
1159
+
1160
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:17:58 -0500
1161
+ Processing by Medivo::LabsController#appointment_data as HTML
1162
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1163
+ Completed 200 OK in 1ms (Views: 0.5ms)
1164
+
1165
+
1166
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:18:42 -0500
1167
+ Processing by Medivo::LabsController#appointment_data as HTML
1168
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1169
+ Completed 200 OK in 1ms (Views: 1.0ms)
1170
+
1171
+
1172
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:18:58 -0500
1173
+ Processing by Medivo::LabsController#appointment_data as HTML
1174
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1175
+ Completed 200 OK in 1ms (Views: 0.5ms)
1176
+
1177
+
1178
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:19:17 -0500
1179
+ Processing by Medivo::LabsController#appointment_data as HTML
1180
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1181
+ Completed 500 Internal Server Error in 58ms (Views: 0.4ms)
1182
+
1183
+
1184
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:20:06 -0500
1185
+ Processing by Medivo::LabsController#appointment_data as HTML
1186
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1187
+ Completed 500 Internal Server Error in 57ms (Views: 0.4ms)
1188
+
1189
+
1190
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:20:56 -0500
1191
+ Processing by Medivo::LabsController#appointment_data as HTML
1192
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1193
+ Completed 200 OK in 1ms (Views: 0.5ms)
1194
+
1195
+
1196
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 15:21:04 -0500
1197
+ Processing by Medivo::LabsController#appointment_data as HTML
1198
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1199
+ Completed 200 OK in 1ms (Views: 0.5ms)
1200
+
1201
+
1202
+ Started GET "/medivo/labs/appointment_data?appointment_date=11%2F01%2F2011&lab_code=20060" for 127.0.0.1 at 2011-11-09 18:43:07 -0500
1203
+ Processing by Medivo::LabsController#appointment_data as HTML
1204
+ Parameters: {"appointment_date"=>"11/01/2011", "lab_code"=>"20060"}
1205
+ Completed 200 OK in 1ms (Views: 0.5ms)
@@ -1,13 +1,26 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Medivo::Appointment do
4
- it "finds times" do
5
- labcorp_id=20060
6
- date = '11/01/2011'
7
- json = "{\"times\":[\"11/03/2011|08:30 AM\",\"11/04/2011|08:30 AM\",\"11/02/2011|09:00 AM\"]}"
8
- stub_request(:get, "http://test.medivo.com/?labcorp_id=#{labcorp_id}&appointment_date=#{date}").
9
- to_return(:body => json)
10
- Medivo::Appointment.find(labcorp_id,date).should == json
4
+ let(:lab_code) { 20060 }
5
+ let(:date) { '11/01/2011' }
6
+ let(:am_pm) {}
7
+
8
+ describe "with valid data" do
9
+ let(:body) { {'time'=> ["11/03/2011|08:30 AM", "11/04/2011|08:30 AM"]} }
10
+
11
+ it "returns times" do
12
+ stub_appointment_request(lab_code, date, am_pm, body)
13
+ Medivo::Appointment.find(lab_code, date).should == body
14
+ end
15
+ end
16
+
17
+ describe "with invalid request returns error message" do
18
+ let(:body) { {'message'=> "invalid data"} }
19
+
20
+ it "for status 400" do
21
+ stub_appointment_request(lab_code, date, am_pm, body, 400)
22
+ expect { Medivo::Appointment.find(lab_code, date) }.to raise_error
23
+ end
11
24
  end
12
25
  end
13
26
 
@@ -28,5 +28,28 @@ describe 'LabController' do
28
28
  end
29
29
  end
30
30
 
31
+ describe "making appointments" do
32
+
33
+ before do
34
+ @lab_code = "20060"
35
+ @date = "11/01/2011"
36
+ @am_pm = ''
37
+ end
38
+
39
+ it "/labs/appointments returns appointment data as json" do
40
+ body = {'time'=> ["11/03/2011|08:30 AM", "11/04/2011|08:30 AM"]}
41
+ stub(Medivo::Appointment).find(@lab_code, @date, nil) { body }
42
+ visit Medivo::Engine.routes.url_helpers.data_appointments_path :lab_code=>@lab_code, :appointment_date=>@date
43
+ page.body.should match "08:30 AM"
44
+ end
45
+
46
+ #it "/labs/appointments returns appointment data as json", :js=>true, :driver=>:selenium_chrome do
47
+ # body = {'time'=> ["11/03/2011|08:30 AM", "11/04/2011|08:30 AM"]}
48
+ # stub(Medivo::Appointment).find(@lab_code, @date, nil) { body }
49
+ # visit Medivo::Engine.routes.url_helpers.data_appointments_path :lab_code=>@lab_code, :appointment_date=>@date
50
+ # page.body.should match "08:30 AM"
51
+ #end
52
+ end
53
+
31
54
  end
32
55
 
@@ -34,6 +34,7 @@ module Medivo::Spec
34
34
  end
35
35
 
36
36
  FIXTURE_PATH = File.expand_path('../../fixtures', __FILE__) unless defined? FIXTURE_PATH
37
+
37
38
  def medivo_fixture_path(file_name)
38
39
  "#{FIXTURE_PATH}/#{file_name}"
39
40
  end
@@ -43,7 +44,8 @@ module Medivo::Spec
43
44
  # file_path String points to the path to xml file with order info which contains
44
45
  # requisition that includes requisition pdf
45
46
  def stub_order_requisition(requisition_id, file_path)
46
- stub_request(:get, "test:test@test.medivo.com/customers/#{requisition_id}.xml?include=requisition").
47
+ stub_request(:get,
48
+ "test:test@test.medivo.com/customers/#{requisition_id}.xml?include=requisition").
47
49
  to_return(:body => File.read(file_path))
48
50
  end
49
51
 
@@ -52,7 +54,15 @@ module Medivo::Spec
52
54
  # file_path String points to the path to xml file with order info which contains
53
55
  # result info that includes result pdf
54
56
  def stub_order_result(requisition_id, file_path)
55
- stub_request(:get, "test:test@test.medivo.com/customers/#{requisition_id}.xml?include=reconciled_results").
57
+ stub_request(:get,
58
+ "test:test@test.medivo.com/customers/#{requisition_id}.xml?include=reconciled_results").
56
59
  to_return(:body => File.read(file_path))
57
60
  end
61
+
62
+ def stub_appointment_request(lab_code, date, am_pm, body, status= 200)
63
+ body = body.is_a?(String) ? body : body.to_json
64
+ stub_request(:get,
65
+ "http://test.medivo.com/?labcorp_id=#{lab_code}&appointment_date=#{date}").
66
+ to_return(:body => body, :status=>status)
67
+ end
58
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: medivo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &2169801500 !ruby/object:Gem::Requirement
17
+ requirement: &2156633840 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.1.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2169801500
25
+ version_requirements: *2156633840
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: jquery-rails
28
- requirement: &2169801080 !ruby/object:Gem::Requirement
28
+ requirement: &2156632980 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2169801080
36
+ version_requirements: *2156632980
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: coffee-script
39
- requirement: &2169800620 !ruby/object:Gem::Requirement
39
+ requirement: &2156631700 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *2169800620
47
+ version_requirements: *2156631700
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: haml-rails
50
- requirement: &2169800180 !ruby/object:Gem::Requirement
50
+ requirement: &2156630440 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *2169800180
58
+ version_requirements: *2156630440
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: geocoder
61
- requirement: &2169799760 !ruby/object:Gem::Requirement
61
+ requirement: &2156629000 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *2169799760
69
+ version_requirements: *2156629000
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rest-client
72
- requirement: &2169799340 !ruby/object:Gem::Requirement
72
+ requirement: &2156627860 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *2169799340
80
+ version_requirements: *2156627860
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: pdfkit
83
- requirement: &2169798920 !ruby/object:Gem::Requirement
83
+ requirement: &2156626520 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0'
89
89
  type: :runtime
90
90
  prerelease: false
91
- version_requirements: *2169798920
91
+ version_requirements: *2156626520
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: prawn
94
- requirement: &2169798500 !ruby/object:Gem::Requirement
94
+ requirement: &2156625500 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ! '>='
@@ -99,7 +99,7 @@ dependencies:
99
99
  version: '0'
100
100
  type: :runtime
101
101
  prerelease: false
102
- version_requirements: *2169798500
102
+ version_requirements: *2156625500
103
103
  description: Use the medivo platform to find lab locations, make labcorp appointments,
104
104
  place lab orders
105
105
  email:
@@ -262,7 +262,6 @@ files:
262
262
  - spec/dummy/tmp/cache/assets/E32/FC0/sprockets%2Fe55fb2eef11567fe04fdaf7e73af5ba4
263
263
  - spec/dummy/tmp/cache/assets/E59/D50/sprockets%2Fbe1cc4d9b0efb617e58baa16dd1dee58
264
264
  - spec/dummy/tmp/image_path_fb5f3a59200b_1320622886.pdf
265
- - spec/dummy/tmp/pids/server.pid
266
265
  - spec/fixtures/hepc_negative_results.pdf
267
266
  - spec/fixtures/hepc_result_faq.pdf
268
267
  - spec/fixtures/lc_order_with_normal_results.xml
@@ -300,7 +299,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
300
299
  version: '0'
301
300
  segments:
302
301
  - 0
303
- hash: -800371975511940167
302
+ hash: 3179551727444907382
304
303
  required_rubygems_version: !ruby/object:Gem::Requirement
305
304
  none: false
306
305
  requirements:
@@ -309,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
309
308
  version: '0'
310
309
  segments:
311
310
  - 0
312
- hash: -800371975511940167
311
+ hash: 3179551727444907382
313
312
  requirements: []
314
313
  rubyforge_project:
315
314
  rubygems_version: 1.6.2
@@ -412,7 +411,6 @@ test_files:
412
411
  - spec/dummy/tmp/cache/assets/E32/FC0/sprockets%2Fe55fb2eef11567fe04fdaf7e73af5ba4
413
412
  - spec/dummy/tmp/cache/assets/E59/D50/sprockets%2Fbe1cc4d9b0efb617e58baa16dd1dee58
414
413
  - spec/dummy/tmp/image_path_fb5f3a59200b_1320622886.pdf
415
- - spec/dummy/tmp/pids/server.pid
416
414
  - spec/fixtures/hepc_negative_results.pdf
417
415
  - spec/fixtures/hepc_result_faq.pdf
418
416
  - spec/fixtures/lc_order_with_normal_results.xml