openagent 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ <StaffPersonal RefId="D3E34F419D75101A8C3D00AA001A1652">
2
+ <LocalId>946379881</LocalId>
3
+ <StateProvinceId>C2345681</StateProvinceId>
4
+ <ElectronicIdList>
5
+ <ElectronicId Type="Barcode">206655</ElectronicId>
6
+ </ElectronicIdList>
7
+ <OtherIdList>
8
+ <OtherId Type="0004">333333333</OtherId>
9
+ </OtherIdList>
10
+ <Name Type="04">
11
+ <Prefix>Mr.</Prefix>
12
+ <LastName>Woodall</LastName>
13
+ <FirstName>Charles</FirstName>
14
+ <MiddleName>William</MiddleName>
15
+ <PreferredName>Chuck</PreferredName>
16
+ </Name>
17
+ <Demographics>
18
+ <Gender>M</Gender>
19
+ </Demographics>
20
+ <Title>Principal</Title>
21
+ <AddressList>
22
+ <Address Type="0123">
23
+ <Street>
24
+ <Line1>6799 33rd Ave.</Line1>
25
+ <StreetNumber>6799</StreetNumber>
26
+ <StreetName>33rd</StreetName>
27
+ <StreetType>Ave.</StreetType>
28
+ </Street>
29
+ <City>Chicago</City>
30
+ <StateProvince>IL</StateProvince>
31
+ <Country>US</Country>
32
+ <PostalCode>60660</PostalCode>
33
+ </Address>
34
+ </AddressList>
35
+ <PhoneNumberList>
36
+ <PhoneNumber Type="0096">
37
+ <Number>(312) 555-1234</Number>
38
+ </PhoneNumber>
39
+ </PhoneNumberList>
40
+ <EmailList>
41
+ <Email Type="Primary">chuckw@imginc.com</Email>
42
+ </EmailList>
43
+ <EmployeePersonalRefId>1652D3E34F419D75101A8C3D00AA001A</EmployeePersonalRefId>
44
+ </StaffPersonal>
@@ -0,0 +1,29 @@
1
+ require_relative 'spec_helper'
2
+
3
+ describe SIF::Representation::Model::Group::SIS::SchoolCourseInfo do
4
+ let(:xml) { File.read(fixture('sif/school_course_info.xml')) }
5
+ let(:course_info) { SIF::Model::Group::SIS::SchoolCourseInfo.new }
6
+
7
+ before do
8
+ SIF::Representation::Model::Group::SIS::SchoolCourseInfo.new(course_info).from_xml(xml)
9
+ end
10
+
11
+ it 'parses' do
12
+ course_info.ref_id.should == '9D75101A8C3D00AA001A0000A2E35B35'
13
+ course_info.school_info_ref_id.should == '101A8C3D00AA001A0000A2E35B359D75'
14
+ course_info.school_year.should == '2006'
15
+ course_info.course_code.should == 'CS101'
16
+ course_info.state_course_code.should == '08-001'
17
+ course_info.district_course_code.should == 'CS101'
18
+ area = course_info.subject_areas[0]
19
+ area.code.should == '05'
20
+ area.other_codes[0].code_set.should == 'Text'
21
+ area.other_codes[0].value.should == 'Graphic Arts'
22
+ course_info.course_title.should == "Gif, JPeg, or Png: What's the Difference?"
23
+ course_info.description.should == 'Explore the various types of files related to graphic arts.'
24
+ (course_info.instructional_level.include? '0571').should == true
25
+ course_info.course_credits == '2'
26
+ course_info.core_academic_course.should == 'No'
27
+ course_info.graduation_requirement.should == 'No'
28
+ end
29
+ end
@@ -0,0 +1,61 @@
1
+ require_relative 'spec_helper'
2
+
3
+ describe SIF::Representation::Model::Group::SIS::SectionInfo do
4
+ let(:xml) { File.read(fixture('sif/section_info.xml')) }
5
+ let(:section_info) { SIF::Model::Group::SIS::SectionInfo.new }
6
+
7
+ before do
8
+ SIF::Representation::Model::Group::SIS::SectionInfo.new(section_info).from_xml(xml)
9
+ end
10
+
11
+ it 'parses' do
12
+ section_info.ref_id.should == 'D3E34B359D75101A8C3D00AA001A1652'
13
+ section_info.school_course_info_ref_id.should == 'A2E35B359D75101A8C3D00AA001A0000'
14
+ section_info.school_year.should == '2006'
15
+ section_info.local_id.should == '287-1'
16
+ schedule_info = section_info.schedule_infos[0]
17
+ schedule_info.teachers[0].should == 'A8C3A2E35B359D75101D00AA001A0000'
18
+ schedule_info.teachers[1].should == 'A8C45DC6B3359D75101D00A456BE9000'
19
+ schedule_info.section_rooms[0].should == '94785736AB3671090BDD87593A264086'
20
+ meeting_times = schedule_info.meeting_times
21
+ meeting_times[0].timetable_day.should == 'M'
22
+ meeting_times[0].timetable_period.should == '6'
23
+ meeting_times[1].timetable_day.should == 'T'
24
+ meeting_times[1].timetable_period.should == '6'
25
+ meeting_times[2].timetable_day.should == 'W'
26
+ meeting_times[2].timetable_period.should == '6'
27
+ meeting_times[3].timetable_day.should == 'R'
28
+ meeting_times[3].timetable_period.should == '6'
29
+ meeting_times[4].timetable_day.should == 'F'
30
+ meeting_times[4].timetable_period.should == '6'
31
+ schedule_info = section_info.schedule_infos[1]
32
+ schedule_info.teachers[0].should == 'CC543E35B359D75101D00AA001A00703'
33
+ schedule_info.section_rooms[0].should == '94785736AB3671090BDD87593A264086'
34
+ meeting_times = schedule_info.meeting_times
35
+ meeting_times[0].timetable_day.should == 'M'
36
+ meeting_times[0].timetable_period.should == '4'
37
+ meeting_times[1].timetable_day.should == 'T'
38
+ meeting_times[1].timetable_period.should == '4'
39
+ meeting_times[2].timetable_day.should == 'W'
40
+ meeting_times[2].timetable_period.should == '4'
41
+ meeting_times[3].timetable_day.should == 'R'
42
+ meeting_times[3].timetable_period.should == '4'
43
+ meeting_times[4].timetable_day.should == 'F'
44
+ meeting_times[4].timetable_period.should == '4'
45
+ section_info.medium_of_instruction.strip.should == '0605'
46
+ section_info.language_of_instruction.strip.should == 'eng'
47
+ (section_info.location_of_instruction.include? '0340').should == true
48
+ (section_info.location_of_instruction.include? 'Pennsylvania College of Technology').should == true
49
+ override = section_info.school_course_info_override
50
+ override.override.should == 'Yes'
51
+ override.course_code.should == 'CS101A'
52
+ override.state_course_code.should == '08-001A'
53
+ override.district_course_code.should == 'CS101A'
54
+ area = override.subject_area
55
+ (area.include? '05').should == true
56
+ (area.include? 'Graphic Arts for Beginners').should == true
57
+ override.course_title.should == 'Graphics Basics'
58
+ override.instructional_level.strip.should == '0570'
59
+ override.course_credits.should == '0.50'
60
+ end
61
+ end
@@ -0,0 +1,105 @@
1
+ require_relative 'spec_helper'
2
+
3
+ describe SIF::Representation::Model::Group::SIS::StaffPersonal do
4
+ let(:xml) { File.read(fixture('sif/staff_personal.xml')) }
5
+ let(:staff) { SIF::Model::Group::SIS::StaffPersonal.new }
6
+
7
+ before do
8
+ SIF::Representation::Model::Group::SIS::StaffPersonal.new(staff).from_xml(xml)
9
+ end
10
+
11
+ it 'parses' do
12
+ staff.ref_id.should == 'D3E34F419D75101A8C3D00AA001A1652'
13
+ staff.local_id.should == '946379881'
14
+ staff.state_province_id.should == 'C2345681'
15
+ eid = staff.electronic_ids[0]
16
+ eid.type.should == 'Barcode'
17
+ eid.value.should == '206655'
18
+ name = staff.name
19
+ name.type.should == '04'
20
+ name.prefix.should == 'Mr.'
21
+ name.last_name.should == 'Woodall'
22
+ name.first_name.should == 'Charles'
23
+ name.middle_name.should == 'William'
24
+ name.preferred_name.should == 'Chuck'
25
+ staff.demographics.gender.should == 'M'
26
+ address = staff.addresses[0]
27
+ address.type.should == '0123'
28
+ address.street.line1.should == '6799 33rd Ave.'
29
+ address.street.street_number.should == '6799'
30
+ address.street.street_name.should == '33rd'
31
+ address.street.street_type.should == 'Ave.'
32
+ address.city.should == 'Chicago'
33
+ address.state_province.should == 'IL'
34
+ address.country.should == 'US'
35
+ address.postal_code.should == '60660'
36
+ phone = staff.phone_numbers[0]
37
+ phone.type.should == '0096'
38
+ phone.number.should == '(312) 555-1234'
39
+ email = staff.emails[0]
40
+ email.type.should == 'Primary'
41
+ email.value.should == 'chuckw@imginc.com'
42
+ staff.employee_personal_ref_id.should == '1652D3E34F419D75101A8C3D00AA001A'
43
+ end
44
+
45
+ it 'writes' do
46
+ new_staff = SIF::Model::Group::SIS::StaffPersonal.new(
47
+ :ref_id => 'D3E34F419D75101A8C3D00AA001A1652',
48
+ :local_id => '946379881',
49
+ :state_province_id => 'C2345681',
50
+ :electronic_ids => [
51
+ SIF::Model::Common::ElectronicId.new(
52
+ :type => 'Barcode',
53
+ :value => '206655'
54
+ )
55
+ ],
56
+ :other_ids => SIF::Model::Common::OtherId.new(
57
+ :type => '0004',
58
+ :value => '333333333'
59
+ ),
60
+ :name => SIF::Model::Common::Name.new(
61
+ :type => '04',
62
+ :prefix => 'Mr.',
63
+ :last_name => 'Woodall',
64
+ :first_name => 'Charles',
65
+ :middle_name => 'William',
66
+ :preferred_name => 'Chuck'
67
+ ),
68
+ :demographics => SIF::Model::Common::Demographics.new(
69
+ :gender => 'M'
70
+ ),
71
+ :title => 'Principal',
72
+ :addresses => [
73
+ SIF::Model::Common::Address.new(
74
+ :type => '0123',
75
+ :street => SIF::Model::Common::Street.new(
76
+ :line1 => '6799 33rd Ave.',
77
+ :street_number => '6799',
78
+ :street_name => '33rd',
79
+ :street_type => 'Ave.'
80
+ ),
81
+ :city => 'Chicago',
82
+ :state_province => 'IL',
83
+ :country => 'US',
84
+ :postal_code => '60660'
85
+ )
86
+ ],
87
+ :phone_numbers => [
88
+ SIF::Model::Common::PhoneNumber.new(
89
+ :type => '0096',
90
+ :number => '(312) 555-1234'
91
+ )
92
+ ],
93
+ :emails => [
94
+ :type => 'Primary',
95
+ :value => 'chuckw@imginc.com'
96
+ ],
97
+ :employee_personal_ref_id => '1652D3E34F419D75101A8C3D00AA001A'
98
+ )
99
+
100
+ orig_xml = SIF::Representation::Model::Group::SIS::StaffPersonal.new(staff).to_xml
101
+ new_xml = SIF::Representation::Model::Group::SIS::StaffPersonal.new(new_staff).to_xml
102
+
103
+ new_xml.should == orig_xml
104
+ end
105
+ end
@@ -1,69 +1,107 @@
1
1
  require_relative 'spec_helper'
2
2
 
3
3
  describe SIF::Representation::Model::Group::SIS::StudentPersonal do
4
- # let(:xml) { File.read(fixture("sif/student_personal.xml")) }
5
- # let(:student) { SIF::Model::Group::SIS::StudentPersonal.new }
4
+ let(:xml) { File.read(fixture('sif/student_personal.xml')) }
5
+ let(:student) { SIF::Model::Group::SIS::StudentPersonal.new }
6
6
 
7
- # before do
8
- # SIF::Representation::Model::Group::SIS::StudentPersonal.new(student).
9
- # from_xml(xml)
10
- # end
11
-
12
- it "justworks" do
13
- jwxml = <<-myxml
14
- <user>
15
- <addresses>
16
- <address type="01">123 Street</address>
17
- <address>123 Street</address>
18
- <address type="02">Cardboard Box</address>
19
- <address>Cardboard Box</address>
20
- <address>10</address>
21
- </addresses>
22
- </user>
23
- myxml
24
-
25
-
26
- class Address
27
- include Virtus.model
28
-
29
- attribute :type, String
30
- attribute :value, String
31
- attribute :asint, Integer
32
- end
33
-
34
- class User
35
- include Virtus.model
36
- attribute :addresses, Array[Address]
37
- end
7
+ before do
8
+ SIF::Representation::Model::Group::SIS::StudentPersonal.new(student).from_xml(xml)
9
+ end
38
10
 
39
- class AddressRep < Representable::Decorator
40
- include Representable::XML
41
- self.representation_wrap = :address
42
- property :type, :attribute => true
43
- property :value, :as => 'address', :content => true
44
- property :asint, :as => 'address', :content => true
45
- end
11
+ it 'parses' do
12
+ student.ref_id.should == 'D3E34B359D75101A8C3D00AA001A1652'
13
+ alert = student.alert_messages[0]
14
+ alert.type.should == 'Legal'
15
+ alert.value.should == 'This is the Legal Alert for Joe Student'
16
+ student.local_id.should == 'P00001'
17
+ student.state_province_id.should == 'WB0025'
18
+ eid = student.electronic_ids[0]
19
+ eid.type.should == 'Barcode'
20
+ eid.value.should == '206654'
21
+ name = student.name
22
+ name.type.should == '04'
23
+ name.last_name.should == 'Student'
24
+ name.first_name.should == 'Joe'
25
+ name.middle_name.should == ''
26
+ name.preferred_name.should == 'Joe'
27
+ student.demographics.gender.should == 'M'
28
+ address = student.addresses[0]
29
+ address.type.should == '0123'
30
+ address.street.line1.should == '6799 33rd Ave.'
31
+ address.street.street_number.should == '6799'
32
+ address.street.street_name.should == '33rd'
33
+ address.street.street_type.should == 'Ave.'
34
+ address.city.should == 'Chicago'
35
+ address.state_province.should == 'IL'
36
+ address.country.should == 'US'
37
+ address.postal_code.should == '60660'
38
+ phone = student.phone_numbers[0]
39
+ phone.type.should == '0096'
40
+ phone.number.should == '(312) 555-1234'
41
+ email = student.emails[0]
42
+ email.type.should == 'Primary'
43
+ email.value.should == 'Joe.Student@anyschool.com'
44
+ student.on_time_graduation_year.should == 2007
45
+ end
46
46
 
47
- class UserRep < Representable::Decorator
48
- include Representable::XML
49
- self.representation_wrap = :user
50
- collection :addresses, :as => :address, :wrap => :addresses,
51
- :class => Address, :decorator => AddressRep
52
- end
47
+ it 'writes' do
48
+ new_student = SIF::Model::Group::SIS::StudentPersonal.new(
49
+ :ref_id => 'D3E34B359D75101A8C3D00AA001A1652',
50
+ :alert_messages => [
51
+ SIF::Model::Common::AlertMessage.new(
52
+ :type => 'Legal',
53
+ :value => 'This is the Legal Alert for Joe Student'
54
+ )
55
+ ],
56
+ :local_id => 'P00001',
57
+ :state_province_id => 'WB0025',
58
+ :electronic_ids => [
59
+ SIF::Model::Common::ElectronicId.new(
60
+ :type => 'Barcode',
61
+ :value => '206654'
62
+ )
63
+ ],
64
+ :name => SIF::Model::Common::Name.new(
65
+ :type => '04',
66
+ :last_name => 'Student',
67
+ :first_name => 'Joe',
68
+ :middle_name => '',
69
+ :preferred_name => 'Joe'
70
+ ),
71
+ :demographics => SIF::Model::Common::Demographics.new(
72
+ :gender => 'M'
73
+ ),
74
+ :addresses => [
75
+ SIF::Model::Common::Address.new(
76
+ :type => '0123',
77
+ :street => SIF::Model::Common::Street.new(
78
+ :line1 => '6799 33rd Ave.',
79
+ :street_number => '6799',
80
+ :street_name => '33rd',
81
+ :street_type => 'Ave.'
82
+ ),
83
+ :city => 'Chicago',
84
+ :state_province => 'IL',
85
+ :country => 'US',
86
+ :postal_code => '60660'
87
+ )
88
+ ],
89
+ :phone_numbers => [
90
+ SIF::Model::Common::PhoneNumber.new(
91
+ :type => '0096',
92
+ :number => '(312) 555-1234'
93
+ )
94
+ ],
95
+ :emails => [
96
+ :type => 'Primary',
97
+ :value => 'Joe.Student@anyschool.com'
98
+ ],
99
+ :on_time_graduation_year => 2007
100
+ )
53
101
 
54
- user = User.new;
55
- UserRep.new(user).from_xml(jwxml)
56
- user.addresses.should_not == nil
102
+ orig_xml = SIF::Representation::Model::Group::SIS::StudentPersonal.new(student).to_xml
103
+ new_xml = SIF::Representation::Model::Group::SIS::StudentPersonal.new(new_student).to_xml
57
104
 
105
+ new_xml.should == orig_xml
58
106
  end
59
-
60
- # it "parses" do
61
- # SIF::Representation::Model::Group::SIS::StudentPersonal.new(student).from_xml(xml);
62
- # student.ref_id.should == "D3E34B359D75101A8C3D00AA001A1652"
63
- # messages = student.alert_messages
64
- # for message in messages
65
- # message.type.should == "Legal"
66
- # #message.value.should == "This is the Legal Alert for Joe Student"
67
- # end
68
- # end
69
107
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-11-15 00:00:00.000000000 Z
14
+ date: 2013-11-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
@@ -356,6 +356,7 @@ files:
356
356
  - spec/fixtures/sif/demographics.xml
357
357
  - spec/fixtures/sif/discipline_incident.xml
358
358
  - spec/fixtures/sif/lea_info.xml
359
+ - spec/fixtures/sif/school_course_info.xml
359
360
  - spec/fixtures/sif/section_info.xml
360
361
  - spec/fixtures/sif/sif_header.xml
361
362
  - spec/fixtures/sif/sif_message__response.xml
@@ -368,6 +369,7 @@ files:
368
369
  - spec/fixtures/sif/sif_request.xml
369
370
  - spec/fixtures/sif/sif_response.xml
370
371
  - spec/fixtures/sif/sif_system_control.xml
372
+ - spec/fixtures/sif/staff_personal.xml
371
373
  - spec/fixtures/sif/stu_pers_resp.xml
372
374
  - spec/fixtures/sif/student_personal.xml
373
375
  - spec/fixtures/zone.yaml
@@ -382,7 +384,10 @@ files:
382
384
  - spec/sif/representations/xml/register_spec.rb
383
385
  - spec/sif/representations/xml/request_spec.rb
384
386
  - spec/sif/representations/xml/response_spec.rb
387
+ - spec/sif/representations/xml/school_course_info_spec.rb
388
+ - spec/sif/representations/xml/section_info_spec.rb
385
389
  - spec/sif/representations/xml/spec_helper.rb
390
+ - spec/sif/representations/xml/staff_personal_spec.rb
386
391
  - spec/sif/representations/xml/student_personal_spec.rb
387
392
  - spec/spec_helper.rb
388
393
  - spec/zone_spec.rb
@@ -422,6 +427,7 @@ test_files:
422
427
  - spec/fixtures/sif/demographics.xml
423
428
  - spec/fixtures/sif/discipline_incident.xml
424
429
  - spec/fixtures/sif/lea_info.xml
430
+ - spec/fixtures/sif/school_course_info.xml
425
431
  - spec/fixtures/sif/section_info.xml
426
432
  - spec/fixtures/sif/sif_header.xml
427
433
  - spec/fixtures/sif/sif_message__response.xml
@@ -434,6 +440,7 @@ test_files:
434
440
  - spec/fixtures/sif/sif_request.xml
435
441
  - spec/fixtures/sif/sif_response.xml
436
442
  - spec/fixtures/sif/sif_system_control.xml
443
+ - spec/fixtures/sif/staff_personal.xml
437
444
  - spec/fixtures/sif/stu_pers_resp.xml
438
445
  - spec/fixtures/sif/student_personal.xml
439
446
  - spec/fixtures/zone.yaml
@@ -448,7 +455,10 @@ test_files:
448
455
  - spec/sif/representations/xml/register_spec.rb
449
456
  - spec/sif/representations/xml/request_spec.rb
450
457
  - spec/sif/representations/xml/response_spec.rb
458
+ - spec/sif/representations/xml/school_course_info_spec.rb
459
+ - spec/sif/representations/xml/section_info_spec.rb
451
460
  - spec/sif/representations/xml/spec_helper.rb
461
+ - spec/sif/representations/xml/staff_personal_spec.rb
452
462
  - spec/sif/representations/xml/student_personal_spec.rb
453
463
  - spec/spec_helper.rb
454
464
  - spec/zone_spec.rb