Update spec

Irfan Charania 9 ans auparavant
Parent
Commettre
ae21d7e984
1 fichiers modifiés avec 12 ajouts et 10 suppressions
  1. 12 10
      spec/models/agents/data_output_agent_spec.rb

+ 12 - 10
spec/models/agents/data_output_agent_spec.rb

@@ -117,8 +117,9 @@ describe Agents::DataOutputAgent do
117 117
         expect(content_type).to eq('text/xml')
118 118
         expect(content.gsub(/\s+/, '')).to eq Utils.unindent(<<-XML).gsub(/\s+/, '')
119 119
           <?xml version="1.0" encoding="UTF-8" ?>
120
-          <rss version="2.0">
120
+          <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
121 121
           <channel>
122
+           <atom:linkhref="https://yoursite.com/users/#{agent.user.id}/web_requests/#{agent.id}/secret1.xml" rel="self" type="application/rss+xml"/>
122 123
            <title>XKCD comics as a feed</title>
123 124
            <description>This is a feed of recent XKCD comics, generated by Huginn</description>
124 125
            <link>https://yoursite.com</link>
@@ -131,7 +132,7 @@ describe Agents::DataOutputAgent do
131 132
             <description>Secret hovertext: Something else</description>
132 133
             <link>http://imgs.xkcd.com/comics/evolving0.png</link>
133 134
             <pubDate>#{Time.zone.parse(event3.payload['date']).rfc2822}</pubDate>
134
-            <guid>#{event3.id}</guid>
135
+            <guid isPermaLink="false">#{event3.id}</guid>
135 136
            </item>
136 137
 
137 138
            <item>
@@ -139,7 +140,7 @@ describe Agents::DataOutputAgent do
139 140
             <description>Secret hovertext: Something else</description>
140 141
             <link>http://imgs.xkcd.com/comics/evolving2.png</link>
141 142
             <pubDate>#{event2.created_at.rfc2822}</pubDate>
142
-            <guid>#{event2.id}</guid>
143
+            <guid isPermaLink="false">#{event2.id}</guid>
143 144
            </item>
144 145
 
145 146
            <item>
@@ -147,7 +148,7 @@ describe Agents::DataOutputAgent do
147 148
             <description>Secret hovertext: Biologists play reverse Pokemon, trying to avoid putting any one team member on the front lines long enough for the experience to cause evolution.</description>
148 149
             <link>http://imgs.xkcd.com/comics/evolving.png</link>
149 150
             <pubDate>#{event1.created_at.rfc2822}</pubDate>
150
-            <guid>#{event1.id}</guid>
151
+            <guid isPermaLink="false">#{event1.id}</guid>
151 152
            </item>
152 153
 
153 154
           </channel>
@@ -170,7 +171,7 @@ describe Agents::DataOutputAgent do
170 171
               'title' => 'Evolving yet again with a past date',
171 172
               'description' => 'Secret hovertext: Something else',
172 173
               'link' => 'http://imgs.xkcd.com/comics/evolving0.png',
173
-              'guid' => event3.id,
174
+              'guid' => {"contents" => event3.id, "isPermaLink" => "false"},
174 175
               'pubDate' => Time.zone.parse(event3.payload['date']).rfc2822,
175 176
               'foo' => 'hi'
176 177
             },
@@ -178,7 +179,7 @@ describe Agents::DataOutputAgent do
178 179
               'title' => 'Evolving again',
179 180
               'description' => 'Secret hovertext: Something else',
180 181
               'link' => 'http://imgs.xkcd.com/comics/evolving2.png',
181
-              'guid' => event2.id,
182
+              'guid' => {"contents" => event2.id, "isPermaLink" => "false"},
182 183
               'pubDate' => event2.created_at.rfc2822,
183 184
               'foo' => 'hi'
184 185
             },
@@ -186,7 +187,7 @@ describe Agents::DataOutputAgent do
186 187
               'title' => 'Evolving',
187 188
               'description' => 'Secret hovertext: Biologists play reverse Pokemon, trying to avoid putting any one team member on the front lines long enough for the experience to cause evolution.',
188 189
               'link' => 'http://imgs.xkcd.com/comics/evolving.png',
189
-              'guid' => event1.id,
190
+              'guid' => {"contents" => event1.id, "isPermaLink" => "false"},
190 191
               'pubDate' => event1.created_at.rfc2822,
191 192
               'foo' => 'hi'
192 193
             }
@@ -256,7 +257,7 @@ describe Agents::DataOutputAgent do
256 257
             'title' => 'Evolving',
257 258
             'description' => 'Secret hovertext: Biologists play reverse Pokemon, trying to avoid putting any one team member on the front lines long enough for the experience to cause evolution.',
258 259
             'link' => 'http://imgs.xkcd.com/comics/evolving.png',
259
-            'guid' => event.id,
260
+            'guid' => {"contents" => event.id, "isPermaLink" => "false"},
260 261
             'pubDate' => event.created_at.rfc2822,
261 262
             'enclosure' => {
262 263
               "type" => "audio/mpeg",
@@ -291,8 +292,9 @@ describe Agents::DataOutputAgent do
291 292
         expect(content_type).to eq('text/xml')
292 293
         expect(content.gsub(/\s+/, '')).to eq Utils.unindent(<<-XML).gsub(/\s+/, '')
293 294
           <?xml version="1.0" encoding="UTF-8" ?>
294
-          <rss version="2.0">
295
+          <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
295 296
           <channel>
297
+           <atom:linkhref="https://yoursite.com/users/#{agent.user.id}/web_requests/#{agent.id}/secret1.xml" rel="self" type="application/rss+xml"/>
296 298
            <title>XKCD comics as a feed</title>
297 299
            <description>This is a feed of recent XKCD comics, generated by Huginn</description>
298 300
            <link>https://yoursite.com</link>
@@ -316,7 +318,7 @@ describe Agents::DataOutputAgent do
316 318
                  </first>
317 319
                </complex>
318 320
              </simpleNested>
319
-             <guid>#{event.id}</guid>
321
+             <guid isPermaLink="false">#{event.id}</guid>
320 322
            </item>
321 323
 
322 324
           </channel>