@@ -85,6 +85,42 @@ class ScrollsController < ActionController::Base
85
85
entry.content(scroll.body, :type => 'html')
86
86
entry.tag!('app:edited', Time.now)
87
87
88
+ entry.author do |author|
89
+ author.name("DHH")
90
+ end
91
+ end
92
+ end
93
+ end
94
+ EOT
95
+ FEEDS [ "feed_with_xml_processing_instructions" ] = <<-EOT
96
+ atom_feed(:schema_date => '2008',
97
+ :instruct => {'xml-stylesheet' => { :href=> 't.css', :type => 'text/css' }}) do |feed|
98
+ feed.title("My great blog!")
99
+ feed.updated((@scrolls.first.created_at))
100
+
101
+ for scroll in @scrolls
102
+ feed.entry(scroll) do |entry|
103
+ entry.title(scroll.title)
104
+ entry.content(scroll.body, :type => 'html')
105
+
106
+ entry.author do |author|
107
+ author.name("DHH")
108
+ end
109
+ end
110
+ end
111
+ end
112
+ EOT
113
+ FEEDS [ "feed_with_xml_processing_instructions_duplicate_targets" ] = <<-EOT
114
+ atom_feed(:schema_date => '2008',
115
+ :instruct => {'target1' => [{ :a => '1', :b => '2' }, { :c => '3', :d => '4' }]}) do |feed|
116
+ feed.title("My great blog!")
117
+ feed.updated((@scrolls.first.created_at))
118
+
119
+ for scroll in @scrolls
120
+ feed.entry(scroll) do |entry|
121
+ entry.title(scroll.title)
122
+ entry.content(scroll.body, :type => 'html')
123
+
88
124
entry.author do |author|
89
125
author.name("DHH")
90
126
end
@@ -194,6 +230,21 @@ def test_feed_should_allow_overriding_ids
194
230
end
195
231
end
196
232
233
+ def test_feed_xml_processing_instructions
234
+ with_restful_routing ( :scrolls ) do
235
+ get :index , :id => 'feed_with_xml_processing_instructions'
236
+ assert_match %r{<\? xml-stylesheet type="text/css" href="t.css"\? >} , @response . body
237
+ end
238
+ end
239
+
240
+ def test_feed_xml_processing_instructions_duplicate_targets
241
+ with_restful_routing ( :scrolls ) do
242
+ get :index , :id => 'feed_with_xml_processing_instructions_duplicate_targets'
243
+ assert_match %r{<\? target1 (a="1" b="2"|b="2" a="1")\? >} , @response . body
244
+ assert_match %r{<\? target1 (c="3" d="4"|d="4" c="3")\? >} , @response . body
245
+ end
246
+ end
247
+
197
248
private
198
249
def with_restful_routing ( resources )
199
250
with_routing do |set |
0 commit comments