rtunesu 0.2.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. data/.gitignore +3 -0
  2. data/History.txt +0 -5
  3. data/README.txt +2 -2
  4. data/Rakefile +15 -2
  5. data/VERSION +1 -0
  6. data/lib/rtunesu/connection.rb +152 -54
  7. data/lib/rtunesu/document.rb +21 -26
  8. data/lib/rtunesu/entities/course.rb +4 -13
  9. data/lib/rtunesu/entities/division.rb +5 -12
  10. data/lib/rtunesu/entities/external_feed.rb +14 -0
  11. data/lib/rtunesu/entities/group.rb +5 -14
  12. data/lib/rtunesu/entities/permission.rb +1 -5
  13. data/lib/rtunesu/entities/section.rb +15 -11
  14. data/lib/rtunesu/entities/site.rb +6 -13
  15. data/lib/rtunesu/entities/template.rb +4 -0
  16. data/lib/rtunesu/entities/theme.rb +3 -15
  17. data/lib/rtunesu/entities/track.rb +12 -27
  18. data/lib/rtunesu/entity.rb +185 -74
  19. data/lib/rtunesu/log.rb +69 -0
  20. data/lib/rtunesu/subentities.rb +60 -0
  21. data/lib/rtunesu/user.rb +3 -1
  22. data/lib/rtunesu/version.rb +2 -2
  23. data/lib/rtunesu.rb +11 -6
  24. data/lib/show_tree.xml +7 -0
  25. data/spec/connection_spec.rb +6 -30
  26. data/spec/document_spec.rb +82 -8
  27. data/spec/entities/course_spec.rb +13 -40
  28. data/spec/entities/division_spec.rb +13 -3
  29. data/spec/entities/external_feed_spec.rb +21 -0
  30. data/spec/entities/group_spec.rb +14 -3
  31. data/spec/entities/permission_spec.rb +12 -3
  32. data/spec/entities/section_spec.rb +32 -3
  33. data/spec/entities/site_spec.rb +16 -3
  34. data/spec/entities/track_spec.rb +32 -3
  35. data/spec/entity_spec.rb +147 -86
  36. data/spec/fixtures/requests/create_course.xml +17 -0
  37. data/spec/fixtures/requests/create_division.xml +11 -0
  38. data/spec/fixtures/requests/create_group.xml +11 -0
  39. data/spec/fixtures/requests/create_section.xml +11 -0
  40. data/spec/fixtures/requests/delete_course.xml +8 -0
  41. data/spec/fixtures/requests/delete_group.xml +8 -0
  42. data/spec/fixtures/requests/delete_section.txt +8 -0
  43. data/spec/fixtures/requests/show_course.xml +8 -0
  44. data/spec/fixtures/requests/show_group.xml +8 -0
  45. data/spec/fixtures/requests/show_section.xml +8 -0
  46. data/spec/fixtures/requests/update_course.xml +10 -0
  47. data/spec/fixtures/requests/update_group.xml +9 -0
  48. data/spec/fixtures/requests/update_section.txt +10 -0
  49. data/spec/fixtures/responses/failure/create_course.xml +5 -0
  50. data/spec/fixtures/responses/failure/create_division.xml +5 -0
  51. data/spec/fixtures/responses/failure/create_group.xml +5 -0
  52. data/spec/fixtures/responses/failure/create_section.xml +5 -0
  53. data/spec/fixtures/responses/failure/delete_group.xml +5 -0
  54. data/spec/fixtures/responses/failure/show_course.xml +11 -0
  55. data/spec/fixtures/responses/failure/show_division.xml +11 -0
  56. data/spec/fixtures/responses/failure/show_group.xml +11 -0
  57. data/spec/fixtures/responses/failure/show_section.xml +11 -0
  58. data/spec/fixtures/responses/failure/show_site.xml +11 -0
  59. data/spec/fixtures/responses/failure/update_section.txt +5 -0
  60. data/spec/fixtures/responses/success/create_course.xml +5 -0
  61. data/spec/fixtures/responses/success/create_division.xml +5 -0
  62. data/spec/fixtures/responses/success/create_group.xml +5 -0
  63. data/spec/fixtures/responses/success/create_section.xml +5 -0
  64. data/spec/fixtures/responses/success/delete_course.xml +4 -0
  65. data/spec/fixtures/responses/success/delete_division.xml +4 -0
  66. data/spec/fixtures/responses/success/delete_group.xml +4 -0
  67. data/spec/fixtures/responses/success/delete_section.txt +4 -0
  68. data/spec/fixtures/responses/success/delete_section.xml +4 -0
  69. data/spec/fixtures/responses/success/show_course.xml +393 -0
  70. data/spec/fixtures/responses/success/show_division.xml +393 -0
  71. data/spec/fixtures/responses/success/show_group.xml +137 -0
  72. data/spec/fixtures/responses/success/show_section.xml +152 -0
  73. data/spec/fixtures/responses/success/show_site.xml +393 -0
  74. data/spec/fixtures/responses/success/update_course.xml +4 -0
  75. data/spec/fixtures/responses/success/update_division.xml +4 -0
  76. data/spec/fixtures/responses/success/update_group.xml +4 -0
  77. data/spec/fixtures/responses/success/update_section.txt +4 -0
  78. data/spec/fixtures/responses/success/update_section.xml +4 -0
  79. data/spec/fixtures/responses/success/update_site.xml +4 -0
  80. data/spec/spec_helper.rb +72 -7
  81. data/spec/token_generation_spec.rb +23 -0
  82. data/spec/user_spec.rb +3 -3
  83. metadata +81 -76
  84. data/Manifest.txt +0 -77
  85. data/config/hoe.rb +0 -76
  86. data/config/requirements.rb +0 -15
  87. data/lib/multipart.rb +0 -53
  88. data/spec/documents/add_spec.rb +0 -41
  89. data/spec/documents/delete_spec.rb +0 -30
  90. data/spec/documents/merge_spec.rb +0 -30
  91. data/spec/documents/show_tree_spec.rb +0 -16
  92. data/spec/fixtures/add_course.xml +0 -26
  93. data/spec/fixtures/add_division.xml +0 -26
  94. data/spec/fixtures/add_group.xml +0 -27
  95. data/spec/fixtures/add_permission.xml +0 -12
  96. data/spec/fixtures/add_section.xml +0 -34
  97. data/spec/fixtures/add_track.xml +0 -19
  98. data/spec/fixtures/delete_course.xml +0 -8
  99. data/spec/fixtures/delete_division.xml +0 -8
  100. data/spec/fixtures/delete_group.xml +0 -8
  101. data/spec/fixtures/delete_permission.xml +0 -9
  102. data/spec/fixtures/delete_section.xml +0 -8
  103. data/spec/fixtures/delete_track.xml +0 -7
  104. data/spec/fixtures/merge_course.xml +0 -38
  105. data/spec/fixtures/merge_division.xml +0 -47
  106. data/spec/fixtures/merge_group.xml +0 -29
  107. data/spec/fixtures/merge_permission.xml +0 -12
  108. data/spec/fixtures/merge_section.xml +0 -36
  109. data/spec/fixtures/merge_site.xml +0 -31
  110. data/spec/fixtures/merge_track.xml +0 -18
  111. data/spec/fixtures/requests/add_coures_request.xml +0 -0
  112. data/spec/fixtures/show_tree.xml +0 -273
  113. data/spec/fixtures/update_group.xml +0 -7
  114. data/tasks/deployment.rake +0 -34
  115. data/tasks/website.rake +0 -17
  116. data/website/index.html +0 -54
  117. data/website/index.txt +0 -7
  118. data/website/javascripts/rounded_corners_lite.inc.js +0 -285
  119. data/website/stylesheets/screen.css +0 -138
  120. data/website/template.html.erb +0 -48
@@ -0,0 +1,152 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <Site>
5
+ <Name>Michigan</Name>
6
+ <Handle>720939</Handle>
7
+ <AllowSubscription>true</AllowSubscription>
8
+ <AggregateFileSize>663514495789</AggregateFileSize>
9
+ <ThemeHandle>1133838431</ThemeHandle>
10
+ <Permission>
11
+ <Credential>Administrator@urn:mace:umich.edu</Credential>
12
+ <Access>Edit</Access>
13
+ </Permission>
14
+ <Permission>
15
+ <Credential>Authenticated@urn:mace:itunesu.com:sites:umich.edu</Credential>
16
+ <Access>Download</Access>
17
+ </Permission>
18
+ <Permission>
19
+ <Credential>Instructor@urn:mace:itunesu.com:sites:umich.edu:${IDENTIFIER}</Credential>
20
+ <Access>Edit</Access>
21
+ </Permission>
22
+ <Permission>
23
+ <Credential>Learner@urn:mace:itunesu.com:sites:umich.edu:${IDENTIFIER}</Credential>
24
+ <Access>Download</Access>
25
+ </Permission>
26
+ <Permission>
27
+ <Credential>All@urn:mace:itunesu.com:sites:umich.edu</Credential>
28
+ <Access>No Access</Access>
29
+ </Permission>
30
+ <Permission>
31
+ <Credential>Unauthenticated@urn:mace:itunesu.com:sites:umich.edu</Credential>
32
+ <Access>No Access</Access>
33
+ </Permission>
34
+ <Section>
35
+ <Name>NewSection</Name>
36
+ <Handle>2514369219</Handle>
37
+ <AllowSubscription />
38
+ <Course>
39
+ <Name>Test Course X</Name>
40
+ <Handle>2514401752</Handle>
41
+ <Instructor />
42
+ <Description />
43
+ <Identifier />
44
+ <ThemeHandle />
45
+ <ShortName>Test Course A</ShortName>
46
+ <Group>
47
+ <Name>Tab 1</Name>
48
+ <Handle>2516552131</Handle>
49
+ <GroupType>Simple</GroupType>
50
+ <ShortName />
51
+ <Permission />
52
+ <Explicit />
53
+ <Track />
54
+ <SharedObjects />
55
+ <AggregateFileSize />
56
+ <AllowSubscription />
57
+ <ExternalFeed>
58
+ <PollingInterval>Daily</PollingInterval>
59
+ </ExternalFeed>
60
+ </Group>
61
+ <Group>
62
+ <Name>Tab A</Name>
63
+ <Handle>2514370423</Handle>
64
+ <GroupType>Simple</GroupType>
65
+ <ShortName />
66
+ <Permission />
67
+ <Explicit />
68
+ <Track />
69
+ <SharedObjects />
70
+ <AggregateFileSize />
71
+ <AllowSubscription />
72
+ <ExternalFeed>
73
+ <PollingInterval>Never</PollingInterval>
74
+ </ExternalFeed>
75
+ </Group>
76
+ <AggregateFileSize />
77
+ <AllowSubscription />
78
+ </Course>
79
+ <Division />
80
+ <AggregateFileSize />
81
+ <Permission />
82
+ </Section>
83
+ <TopDownloads>
84
+ <Name>Top Downloads</Name>
85
+ <Handle>1651872206</Handle>
86
+ <FeedURL>https://deimos.apple.com/WebObjects/Core.woa/LinkFeed/umich.edu.01651872206</FeedURL>
87
+ </TopDownloads>
88
+ <Theme>
89
+ <Name>Purple On White</Name>
90
+ <Handle>1133838405</Handle>
91
+ <BackgroundColor>ffffff</BackgroundColor>
92
+ <BoxBackgroundColor>000000</BoxBackgroundColor>
93
+ <BoxBackgroundAlphaPercent>15</BoxBackgroundAlphaPercent>
94
+ <SectionHeadingBackgroundColor>990099</SectionHeadingBackgroundColor>
95
+ <LinkTextColor>000000</LinkTextColor>
96
+ <SectionHeadingTextColor>ffffff</SectionHeadingTextColor>
97
+ <RegularTextColor>000000</RegularTextColor>
98
+ </Theme>
99
+ <Theme>
100
+ <Name>The Blues</Name>
101
+ <Handle>1133838418</Handle>
102
+ <BackgroundColor>000033</BackgroundColor>
103
+ <BoxBackgroundColor>ffffff</BoxBackgroundColor>
104
+ <BoxBackgroundAlphaPercent>12</BoxBackgroundAlphaPercent>
105
+ <SectionHeadingBackgroundColor>9999ff</SectionHeadingBackgroundColor>
106
+ <LinkTextColor>ffffff</LinkTextColor>
107
+ <SectionHeadingTextColor>000033</SectionHeadingTextColor>
108
+ <RegularTextColor>ffffff</RegularTextColor>
109
+ </Theme>
110
+ <Theme>
111
+ <Name>iTunes Original</Name>
112
+ <Handle>1133838431</Handle>
113
+ <BackgroundColor>b7defc</BackgroundColor>
114
+ <BoxBackgroundColor>ffffff</BoxBackgroundColor>
115
+ <BoxBackgroundAlphaPercent>50</BoxBackgroundAlphaPercent>
116
+ <SectionHeadingBackgroundColor>3366cc</SectionHeadingBackgroundColor>
117
+ <LinkTextColor>000000</LinkTextColor>
118
+ <SectionHeadingTextColor>ffffff</SectionHeadingTextColor>
119
+ <RegularTextColor>000000</RegularTextColor>
120
+ </Theme>
121
+ <Theme>
122
+ <Name>White On Black</Name>
123
+ <Handle>1133838444</Handle>
124
+ <BackgroundColor>000000</BackgroundColor>
125
+ <BoxBackgroundColor>ffffff</BoxBackgroundColor>
126
+ <BoxBackgroundAlphaPercent>25</BoxBackgroundAlphaPercent>
127
+ <SectionHeadingBackgroundColor>ffffff</SectionHeadingBackgroundColor>
128
+ <LinkTextColor>ffffff</LinkTextColor>
129
+ <SectionHeadingTextColor>000000</SectionHeadingTextColor>
130
+ <RegularTextColor>ffffff</RegularTextColor>
131
+ </Theme>
132
+ <Theme>
133
+ <Name>Custom</Name>
134
+ <Handle>1145110888</Handle>
135
+ <BackgroundColor>003366</BackgroundColor>
136
+ <BoxBackgroundColor>000000</BoxBackgroundColor>
137
+ <BoxBackgroundAlphaPercent>12</BoxBackgroundAlphaPercent>
138
+ <SectionHeadingBackgroundColor>000033</SectionHeadingBackgroundColor>
139
+ <LinkTextColor>ffffff</LinkTextColor>
140
+ <SectionHeadingTextColor>ffcc66</SectionHeadingTextColor>
141
+ <RegularTextColor>ffcc66</RegularTextColor>
142
+ </Theme>
143
+ <LinkCollectionSet>
144
+ <LinkCollection>
145
+ <Name>CustomLinkBox</Name>
146
+ <Handle>16327</Handle>
147
+ <FeedURL>https://deimos.apple.com/WebObjects/Core.woa/LinkFeed/umich.edu.016326.016327</FeedURL>
148
+ </LinkCollection>
149
+ </LinkCollectionSet>
150
+ <LoginURL>https://weblogin.umich.edu</LoginURL>
151
+ </Site>
152
+ </ITunesUResponse>
@@ -0,0 +1,393 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ <Site>
5
+ <Name>Michigan</Name>
6
+ <Handle>720939</Handle>
7
+ <AllowSubscription>true</AllowSubscription>
8
+ <AggregateFileSize>663514495789</AggregateFileSize>
9
+ <ThemeHandle>1133838431</ThemeHandle>
10
+ <Permission>
11
+ <Credential>Administrator@urn:mace:umich.edu</Credential>
12
+ <Access>Edit</Access>
13
+ </Permission>
14
+ <Permission>
15
+ <Credential>Authenticated@urn:mace:itunesu.com:sites:umich.edu</Credential>
16
+ <Access>Download</Access>
17
+ </Permission>
18
+ <Permission>
19
+ <Credential>Instructor@urn:mace:itunesu.com:sites:umich.edu:${IDENTIFIER}</Credential>
20
+ <Access>Edit</Access>
21
+ </Permission>
22
+ <Permission>
23
+ <Credential>Learner@urn:mace:itunesu.com:sites:umich.edu:${IDENTIFIER}</Credential>
24
+ <Access>Download</Access>
25
+ </Permission>
26
+ <Permission>
27
+ <Credential>All@urn:mace:itunesu.com:sites:umich.edu</Credential>
28
+ <Access>No Access</Access>
29
+ </Permission>
30
+ <Permission>
31
+ <Credential>Unauthenticated@urn:mace:itunesu.com:sites:umich.edu</Credential>
32
+ <Access>No Access</Access>
33
+ </Permission>
34
+ <Section>
35
+ <Name>Schools and Colleges</Name>
36
+ <Handle>57704550</Handle>
37
+ <AllowSubscription />
38
+ <Course />
39
+ <Division>
40
+ <Name>Dental School</Name>
41
+ <Handle>1278041</Handle>
42
+ <LinkedFolderHandle />
43
+ <AggregateFileSize>245835901864</AggregateFileSize>
44
+ <Identifier />
45
+ <Permission>
46
+ <Credential>urn:mace:umich.edu:medical:M1:BROWSE</Credential>
47
+ <Access>No Access</Access>
48
+ </Permission>
49
+ <Permission>
50
+ <Credential>urn:mace:umich.edu:medical:M1:EDIT</Credential>
51
+ <Access>No Access</Access>
52
+ </Permission>
53
+ <Permission>
54
+ <Credential>urn:mace:umich.edu:BROWSE</Credential>
55
+ <Access>No Access</Access>
56
+ </Permission>
57
+ <Permission>
58
+ <Credential>urn:mace:umich.edu:EDIT</Credential>
59
+ <Access>No Access</Access>
60
+ </Permission>
61
+ <Permission>
62
+ <Credential>urn:mace:umich.edu:dental:EDIT</Credential>
63
+ <Access>Edit</Access>
64
+ </Permission>
65
+ <Permission>
66
+ <Credential>Authenticated@urn:mace:itunesu.com:sites:umich.edu</Credential>
67
+ <Access>No Access</Access>
68
+ </Permission>
69
+ <Permission>
70
+ <Credential>urn:mace:umich.edu:dental:BROWSE</Credential>
71
+ <Access>Download</Access>
72
+ </Permission>
73
+ <ShortName />
74
+ <Section>
75
+ <Name>Dental Students</Name>
76
+ <Handle>95257757</Handle>
77
+ <AllowSubscription />
78
+ <Course />
79
+ <Division>
80
+ <Name>Class of 2013</Name>
81
+ <Handle>1278043</Handle>
82
+ <LinkedFolderHandle />
83
+ <AggregateFileSize>16048271713</AggregateFileSize>
84
+ <Identifier />
85
+ <ShortName />
86
+ <Section>
87
+ <Name>2009 Fall (D1 2013)</Name>
88
+ <Handle>2394389826</Handle>
89
+ <AllowSubscription />
90
+ <Course>
91
+ <Name>507 Basic Biomaterials</Name>
92
+ <Handle>2394598528</Handle>
93
+ <Instructor />
94
+ <Description />
95
+ <Identifier />
96
+ <ThemeHandle />
97
+ <ShortName>507</ShortName>
98
+ <Permission>
99
+ <Credential>Authenticated@urn:mace:itunesu.com:sites:umich.edu</Credential>
100
+ <Access>No Access</Access>
101
+ </Permission>
102
+ <Group>
103
+ <Name>Audio</Name>
104
+ <Handle>2394598530</Handle>
105
+ <GroupType>Simple</GroupType>
106
+ <ShortName />
107
+ <Permission />
108
+ <Explicit />
109
+ <Track>
110
+ <Name>Dr. Ma - makeup lecture</Name>
111
+ <Handle>2449134252</Handle>
112
+ <Kind>song</Kind>
113
+ <TrackNumber>0</TrackNumber>
114
+ <DiscNumber>1</DiscNumber>
115
+ <DurationMilliseconds>3775000</DurationMilliseconds>
116
+ <AlbumName>507 Basic Biomaterials</AlbumName>
117
+ <ArtistName />
118
+ <GenreName />
119
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598530.2449134252</DownloadURL>
120
+ <Comment>Dr. Ma, 09.08.09, 9-10am</Comment>
121
+ <Explicit />
122
+ </Track>
123
+ <Track>
124
+ <Name>adhesion</Name>
125
+ <Handle>2505813829</Handle>
126
+ <Kind>song</Kind>
127
+ <TrackNumber>0</TrackNumber>
128
+ <DiscNumber>1</DiscNumber>
129
+ <DurationMilliseconds>3277000</DurationMilliseconds>
130
+ <AlbumName />
131
+ <ArtistName />
132
+ <GenreName />
133
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598530.2505813829</DownloadURL>
134
+ <Comment>Ma, 09/21/09, 1-2pm</Comment>
135
+ <Explicit />
136
+ </Track>
137
+ <Track>
138
+ <Name>Dr. Ma's Research</Name>
139
+ <Handle>2529422309</Handle>
140
+ <Kind>song</Kind>
141
+ <TrackNumber>0</TrackNumber>
142
+ <DiscNumber>1</DiscNumber>
143
+ <DurationMilliseconds>3246000</DurationMilliseconds>
144
+ <AlbumName />
145
+ <ArtistName />
146
+ <GenreName />
147
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598530.2529422309</DownloadURL>
148
+ <Comment>09.28.09, 1-2pm</Comment>
149
+ <Explicit />
150
+ </Track>
151
+ <Track>
152
+ <Name>Color</Name>
153
+ <Handle>2556217805</Handle>
154
+ <Kind>song</Kind>
155
+ <TrackNumber>0</TrackNumber>
156
+ <DiscNumber>1</DiscNumber>
157
+ <DurationMilliseconds>3078000</DurationMilliseconds>
158
+ <AlbumName />
159
+ <ArtistName />
160
+ <GenreName />
161
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598530.2556217805</DownloadURL>
162
+ <Comment>Dr. Ma, 09.30.09, 1-2pm</Comment>
163
+ <Explicit />
164
+ </Track>
165
+ <Track>
166
+ <Name>crystal</Name>
167
+ <Handle>2584337812</Handle>
168
+ <Kind>song</Kind>
169
+ <TrackNumber>0</TrackNumber>
170
+ <DiscNumber>1</DiscNumber>
171
+ <DurationMilliseconds>2726000</DurationMilliseconds>
172
+ <AlbumName />
173
+ <ArtistName />
174
+ <GenreName />
175
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598530.2584337812</DownloadURL>
176
+ <Comment>ma, 09.07.09, 1-2pm</Comment>
177
+ <Explicit />
178
+ </Track>
179
+ <Track>
180
+ <Name>Polymers - last lecture</Name>
181
+ <Handle>2597659497</Handle>
182
+ <Kind>song</Kind>
183
+ <TrackNumber>0</TrackNumber>
184
+ <DiscNumber>1</DiscNumber>
185
+ <DurationMilliseconds>3138000</DurationMilliseconds>
186
+ <AlbumName />
187
+ <ArtistName />
188
+ <GenreName />
189
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598530.2597659497</DownloadURL>
190
+ <Comment>Ma, 10.12.09, 1-2pm</Comment>
191
+ <Explicit />
192
+ </Track>
193
+ <SharedObjects />
194
+ <AggregateFileSize>257171378</AggregateFileSize>
195
+ <AllowSubscription />
196
+ <ExternalFeed>
197
+ <PollingInterval>Never</PollingInterval>
198
+ </ExternalFeed>
199
+ </Group>
200
+ <Group>
201
+ <Name>Video</Name>
202
+ <Handle>2394598531</Handle>
203
+ <GroupType>Simple</GroupType>
204
+ <ShortName />
205
+ <Permission />
206
+ <Explicit />
207
+ <Track>
208
+ <Name>Dr. Ma - makeup lecture</Name>
209
+ <Handle>2448922001</Handle>
210
+ <Kind>feature-movie</Kind>
211
+ <TrackNumber>0</TrackNumber>
212
+ <DiscNumber>1</DiscNumber>
213
+ <DurationMilliseconds>3775000</DurationMilliseconds>
214
+ <AlbumName />
215
+ <ArtistName />
216
+ <GenreName />
217
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598531.2448922001</DownloadURL>
218
+ <Comment>Dr. Ma, 09.08.09, 9-10am</Comment>
219
+ <Explicit />
220
+ </Track>
221
+ <Track>
222
+ <Name>adhesion</Name>
223
+ <Handle>2506026367</Handle>
224
+ <Kind>feature-movie</Kind>
225
+ <TrackNumber>0</TrackNumber>
226
+ <DiscNumber>1</DiscNumber>
227
+ <DurationMilliseconds>3277000</DurationMilliseconds>
228
+ <AlbumName />
229
+ <ArtistName />
230
+ <GenreName />
231
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598531.2506026367</DownloadURL>
232
+ <Comment>Ma, 09/21/09, 1-2pm</Comment>
233
+ <Explicit />
234
+ </Track>
235
+ <Track>
236
+ <Name>Dr. Ma's Research</Name>
237
+ <Handle>2526015081</Handle>
238
+ <Kind>feature-movie</Kind>
239
+ <TrackNumber>0</TrackNumber>
240
+ <DiscNumber>1</DiscNumber>
241
+ <DurationMilliseconds>3246000</DurationMilliseconds>
242
+ <AlbumName />
243
+ <ArtistName />
244
+ <GenreName />
245
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598531.2526015081</DownloadURL>
246
+ <Comment>09.28.09, 1-2pm</Comment>
247
+ <Explicit />
248
+ </Track>
249
+ <Track>
250
+ <Name>Color</Name>
251
+ <Handle>2532031070</Handle>
252
+ <Kind>feature-movie</Kind>
253
+ <TrackNumber>0</TrackNumber>
254
+ <DiscNumber>1</DiscNumber>
255
+ <DurationMilliseconds>3078000</DurationMilliseconds>
256
+ <AlbumName />
257
+ <ArtistName />
258
+ <GenreName />
259
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598531.2532031070</DownloadURL>
260
+ <Comment>Dr. Ma, 09.30.09, 1-2pm</Comment>
261
+ <Explicit />
262
+ </Track>
263
+ <Track>
264
+ <Name>crystal</Name>
265
+ <Handle>2584779453</Handle>
266
+ <Kind>feature-movie</Kind>
267
+ <TrackNumber>0</TrackNumber>
268
+ <DiscNumber>1</DiscNumber>
269
+ <DurationMilliseconds>2726000</DurationMilliseconds>
270
+ <AlbumName />
271
+ <ArtistName />
272
+ <GenreName />
273
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598531.2584779453</DownloadURL>
274
+ <Comment>ma, 09.07.09, 1-2pm</Comment>
275
+ <Explicit />
276
+ </Track>
277
+ <Track>
278
+ <Name>Polymers - last lecture</Name>
279
+ <Handle>2597168369</Handle>
280
+ <Kind>feature-movie</Kind>
281
+ <TrackNumber>0</TrackNumber>
282
+ <DiscNumber>1</DiscNumber>
283
+ <DurationMilliseconds>3146000</DurationMilliseconds>
284
+ <AlbumName />
285
+ <ArtistName />
286
+ <GenreName />
287
+ <DownloadURL>https://deimos.apple.com/WebObjects/Core.woa/DownloadTrack/umich.edu.2394598528.02394598531.2597168369</DownloadURL>
288
+ <Comment>Ma, 10.12.09, 1-2pm</Comment>
289
+ <Explicit />
290
+ </Track>
291
+ <SharedObjects />
292
+ <AggregateFileSize>1013196653</AggregateFileSize>
293
+ <AllowSubscription />
294
+ <ExternalFeed>
295
+ <PollingInterval>Never</PollingInterval>
296
+ </ExternalFeed>
297
+ </Group>
298
+ <AggregateFileSize>1270392919</AggregateFileSize>
299
+ <AllowSubscription />
300
+ </Course>
301
+ <Division />
302
+ <AggregateFileSize>16048205125</AggregateFileSize>
303
+ <Permission />
304
+ </Section>
305
+ <ThemeHandle />
306
+ <Description />
307
+ </Division>
308
+ <AggregateFileSize>236525232182</AggregateFileSize>
309
+ <Permission />
310
+ </Section>
311
+ <ThemeHandle />
312
+ <Description />
313
+ </Division>
314
+ <AggregateFileSize>245836169217</AggregateFileSize>
315
+ <Permission>
316
+ <Credential>All@urn:mace:itunesu.com:sites:umich.edu</Credential>
317
+ <Access>No Access</Access>
318
+ </Permission>
319
+ <Permission>
320
+ <Credential>Authenticated@urn:mace:itunesu.com:sites:umich.edu</Credential>
321
+ <Access>No Access</Access>
322
+ </Permission>
323
+ </Section>
324
+ <TopDownloads>
325
+ <Name>Top Downloads</Name>
326
+ <Handle>1651872206</Handle>
327
+ <FeedURL>https://deimos.apple.com/WebObjects/Core.woa/LinkFeed/umich.edu.01651872206</FeedURL>
328
+ </TopDownloads>
329
+ <Theme>
330
+ <Name>Purple On White</Name>
331
+ <Handle>1133838405</Handle>
332
+ <BackgroundColor>ffffff</BackgroundColor>
333
+ <BoxBackgroundColor>000000</BoxBackgroundColor>
334
+ <BoxBackgroundAlphaPercent>15</BoxBackgroundAlphaPercent>
335
+ <SectionHeadingBackgroundColor>990099</SectionHeadingBackgroundColor>
336
+ <LinkTextColor>000000</LinkTextColor>
337
+ <SectionHeadingTextColor>ffffff</SectionHeadingTextColor>
338
+ <RegularTextColor>000000</RegularTextColor>
339
+ </Theme>
340
+ <Theme>
341
+ <Name>The Blues</Name>
342
+ <Handle>1133838418</Handle>
343
+ <BackgroundColor>000033</BackgroundColor>
344
+ <BoxBackgroundColor>ffffff</BoxBackgroundColor>
345
+ <BoxBackgroundAlphaPercent>12</BoxBackgroundAlphaPercent>
346
+ <SectionHeadingBackgroundColor>9999ff</SectionHeadingBackgroundColor>
347
+ <LinkTextColor>ffffff</LinkTextColor>
348
+ <SectionHeadingTextColor>000033</SectionHeadingTextColor>
349
+ <RegularTextColor>ffffff</RegularTextColor>
350
+ </Theme>
351
+ <Theme>
352
+ <Name>iTunes Original</Name>
353
+ <Handle>1133838431</Handle>
354
+ <BackgroundColor>b7defc</BackgroundColor>
355
+ <BoxBackgroundColor>ffffff</BoxBackgroundColor>
356
+ <BoxBackgroundAlphaPercent>50</BoxBackgroundAlphaPercent>
357
+ <SectionHeadingBackgroundColor>3366cc</SectionHeadingBackgroundColor>
358
+ <LinkTextColor>000000</LinkTextColor>
359
+ <SectionHeadingTextColor>ffffff</SectionHeadingTextColor>
360
+ <RegularTextColor>000000</RegularTextColor>
361
+ </Theme>
362
+ <Theme>
363
+ <Name>White On Black</Name>
364
+ <Handle>1133838444</Handle>
365
+ <BackgroundColor>000000</BackgroundColor>
366
+ <BoxBackgroundColor>ffffff</BoxBackgroundColor>
367
+ <BoxBackgroundAlphaPercent>25</BoxBackgroundAlphaPercent>
368
+ <SectionHeadingBackgroundColor>ffffff</SectionHeadingBackgroundColor>
369
+ <LinkTextColor>ffffff</LinkTextColor>
370
+ <SectionHeadingTextColor>000000</SectionHeadingTextColor>
371
+ <RegularTextColor>ffffff</RegularTextColor>
372
+ </Theme>
373
+ <Theme>
374
+ <Name>Custom</Name>
375
+ <Handle>1145110888</Handle>
376
+ <BackgroundColor>003366</BackgroundColor>
377
+ <BoxBackgroundColor>000000</BoxBackgroundColor>
378
+ <BoxBackgroundAlphaPercent>12</BoxBackgroundAlphaPercent>
379
+ <SectionHeadingBackgroundColor>000033</SectionHeadingBackgroundColor>
380
+ <LinkTextColor>ffffff</LinkTextColor>
381
+ <SectionHeadingTextColor>ffcc66</SectionHeadingTextColor>
382
+ <RegularTextColor>ffcc66</RegularTextColor>
383
+ </Theme>
384
+ <LinkCollectionSet>
385
+ <LinkCollection>
386
+ <Name>CustomLinkBox</Name>
387
+ <Handle>16327</Handle>
388
+ <FeedURL>https://deimos.apple.com/WebObjects/Core.woa/LinkFeed/umich.edu.016326.016327</FeedURL>
389
+ </LinkCollection>
390
+ </LinkCollectionSet>
391
+ <LoginURL>https://weblogin.umich.edu</LoginURL>
392
+ </Site>
393
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ITunesUResponse>
3
+ <Version>1.1.3</Version>
4
+ </ITunesUResponse>
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,75 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems'
5
- gem 'rspec'
6
- require 'spec'
7
- end
1
+ require 'rubygems'
2
+ require 'spec'
3
+
4
+ require 'fakeweb'
5
+ FakeWeb.allow_net_connect = false
8
6
 
9
7
  $:.unshift(File.dirname(__FILE__) + '/../lib')
10
8
  require 'rtunesu'
9
+
10
+ def response_for(klass, action, success)
11
+ success_string = success ? "success" : "failure"
12
+ File.read(File.dirname(__FILE__) + "/fixtures/responses/#{success_string}/#{action}_#{klass.name.demodulize.downcase}.xml")
13
+ end
14
+
15
+ def it_should_be_composed_of(*elems)
16
+ elems.each do |attr|
17
+ it "should have attribute #{attr.to_s}" do
18
+ @entity.should respond_to(attr)
19
+ @entity.should respond_to("#{attr}=")
20
+ end
21
+
22
+ it "should access #{attr.to_s} from XML" do
23
+
24
+ end
25
+ end
26
+ end
27
+
28
+ def it_should_be_composed_of_readonly(*elems)
29
+ elems.each do |attr|
30
+ it "should have readonly attribute #{attr.to_s}" do
31
+ @entity.should respond_to(attr)
32
+ @entity.should_not respond_to("#{attr}=")
33
+ end
34
+ end
35
+ end
36
+
37
+ def it_should_have_many(*associations)
38
+ associations.each do |association|
39
+ it "should have many #{association}" do
40
+ @entity.should respond_to(association)
41
+ @entity.send(association).should be_kind_of(HasNEntityCollectionProxy)
42
+ end
43
+ end
44
+ end
45
+
46
+ def it_should_have_a(*associations)
47
+ associations.each do |association|
48
+ it "should have many #{association}" do
49
+ @entity.should respond_to(association)
50
+ @entity.send(association).should be_kind_of(HasAEntityCollectionProxy)
51
+ end
52
+ end
53
+ end
54
+
55
+ def mock_upload_url_for_handle(handle)
56
+ "https://deimos.apple.com/FAKEWEB/UPLOADURL/#{handle}"
57
+ end
58
+
59
+ def mock_connect!
60
+ now = Time.new
61
+ Time.stub!(:now).and_return(now)
62
+ now.stub!(:to_i).and_return(1214619134)
63
+
64
+ user = mock(RTunesU::User, :id => 0,
65
+ :username => 'admin',
66
+ :name => 'Admin',
67
+ :email => 'admin@example.edu',
68
+ :credentials => ['Administrator@urn:mace:itunesu.com:sites:example.edu'],
69
+ :to_credential_string => 'Administrator@urn:mace:itunesu.com:sites:example.edu',
70
+ :to_identity_string => '"Admin" <admin@example.edu> (admin) [0]')
71
+
72
+ @connection = Connection.new(:user => user, :site => 'example.edu', :shared_secret => 'STRINGOFTHIRTYTWOLETTERSORDIGITS')
73
+ RTunesU::Entity.set_base_connection(@connection)
74
+ return "https://deimos.apple.com/WebObjects/Core.woa/API/GetUploadURL/example.edu.1?credentials=Administrator%40urn%3Amace%3Aitunesu.com%3Asites%3Aexample.edu&identity=%22Admin%22+%3Cadmin%40example.edu%3E+%28admin%29+%5B0%5D&time=1214619134&signature=121a6cf76c9c5ecda41450d87e3394b9d02c570a5f76b2bd16287f860f068302&type=XMLControlFile"
75
+ end