@@ -1,8 +1,8 | |||
|
1 | 1 | xml.instruct! |
|
2 | 2 | xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do |
|
3 | 3 | xml.title truncate_single_line(@title, :length => 100) |
|
4 | xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false)) | |
|
5 | xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil)) | |
|
4 | xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false, :escape => false)) | |
|
5 | xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil, :escape => false)) | |
|
6 | 6 | xml.id url_for(:controller => 'welcome', :only_path => false) |
|
7 | 7 | xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema) |
|
8 | 8 | xml.author { xml.name "#{Setting.app_title}" } |
@@ -97,9 +97,39 class ActivitiesControllerTest < ActionController::TestCase | |||
|
97 | 97 | end |
|
98 | 98 | |
|
99 | 99 | def test_index_atom_feed |
|
100 | get :index, :format => 'atom' | |
|
100 | get :index, :format => 'atom', :with_subprojects => 0 | |
|
101 | 101 | assert_response :success |
|
102 | 102 | assert_template 'common/feed.atom' |
|
103 | ||
|
104 | assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil }, | |
|
105 | :attributes => {:rel => 'self', :href => 'http://test.host/activity.atom?with_subprojects=0'} | |
|
106 | assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil }, | |
|
107 | :attributes => {:rel => 'alternate', :href => 'http://test.host/activity?with_subprojects=0'} | |
|
108 | ||
|
109 | assert_tag :tag => 'entry', :child => { | |
|
110 | :tag => 'link', | |
|
111 | :attributes => {:href => 'http://test.host/issues/11'}} | |
|
112 | end | |
|
113 | ||
|
114 | def test_index_atom_feed_with_explicit_selection | |
|
115 | get :index, :format => 'atom', :with_subprojects => 0, | |
|
116 | :show_changesets => 1, | |
|
117 | :show_documents => 1, | |
|
118 | :show_files => 1, | |
|
119 | :show_issues => 1, | |
|
120 | :show_messages => 1, | |
|
121 | :show_news => 1, | |
|
122 | :show_time_entries => 1, | |
|
123 | :show_wiki_edits => 1 | |
|
124 | ||
|
125 | assert_response :success | |
|
126 | assert_template 'common/feed.atom' | |
|
127 | ||
|
128 | assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil }, | |
|
129 | :attributes => {:rel => 'self', :href => 'http://test.host/activity.atom?show_changesets=1&show_documents=1&show_files=1&show_issues=1&show_messages=1&show_news=1&show_time_entries=1&show_wiki_edits=1&with_subprojects=0'} | |
|
130 | assert_tag :tag => 'link', :parent => {:tag => 'feed', :parent => nil }, | |
|
131 | :attributes => {:rel => 'alternate', :href => 'http://test.host/activity?show_changesets=1&show_documents=1&show_files=1&show_issues=1&show_messages=1&show_news=1&show_time_entries=1&show_wiki_edits=1&with_subprojects=0'} | |
|
132 | ||
|
103 | 133 | assert_tag :tag => 'entry', :child => { |
|
104 | 134 | :tag => 'link', |
|
105 | 135 | :attributes => {:href => 'http://test.host/issues/11'}} |
General Comments 0
You need to be logged in to leave comments.
Login now