diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6d15bfc..91b82d8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -871,7 +871,7 @@ module ApplicationHelper def add_rss_feed_to_head(title, url) content_for :feeds do - "" + tag(:link, :rel => 'alternate', :type => 'application/rss+xml', :title => title, :href => url_for(url)) end end diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index b486195..ea95d53 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -178,20 +178,19 @@ class CmsControllerTest < Test::Unit::TestCase should 'be able to create a RSS feed' do login_as(profile.identifier) assert_difference RssFeed, :count do - post :new, :type => RssFeed.name, :profile => profile.identifier, :article => { :name => 'new-feed', :limit => 15, :include => 'all', :feed_item_description => 'body' } + post :new, :type => RssFeed.name, :profile => profile.identifier, :article => { :name => 'new-feed', :limit => 15, :include => 'all' } assert_response :redirect end end should 'be able to update a RSS feed' do login_as(profile.identifier) - feed = RssFeed.create!(:name => 'myfeed', :limit => 5, :feed_item_description => 'body', :include => 'all', :profile_id => profile.id) - post :edit, :profile => profile.identifier, :id => feed.id, :article => { :limit => 77, :feed_item_description => 'abstract', :include => 'parent_and_children' } + feed = RssFeed.create!(:name => 'myfeed', :limit => 5, :include => 'all', :profile_id => profile.id) + post :edit, :profile => profile.identifier, :id => feed.id, :article => { :limit => 77, :include => 'parent_and_children' } assert_response :redirect updated = RssFeed.find(feed.id) assert_equal 77, updated.limit - assert_equal 'abstract', updated.feed_item_description assert_equal 'parent_and_children', updated.include end diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index bf82ee9..f8f8e7b 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -672,7 +672,7 @@ class ContentViewerControllerTest < Test::Unit::TestCase login_as(profile.identifier) profile.articles << Blog.new(:name => 'Blog', :profile => profile) get :view_page, :profile => profile.identifier, :page => ['blog'] - assert_tag :tag => 'link', :attributes => { :rel => 'alternate', :type => 'application/rss+xml', :title => 'feed', :href => "http://#{environment.default_hostname}/testinguser/blog/feed" } + assert_tag :tag => 'link', :attributes => { :rel => 'alternate', :type => 'application/rss+xml', :title => 'Blog', :href => "http://#{environment.default_hostname}/testinguser/blog/feed" } end should 'add meta tag to rss feed on view post blog' do @@ -680,7 +680,7 @@ class ContentViewerControllerTest < Test::Unit::TestCase profile.articles << Blog.new(:name => 'Blog', :profile => profile) profile.blog.posts << TextileArticle.new(:name => 'first post', :parent => profile.blog, :profile => profile) get :view_page, :profile => profile.identifier, :page => ['blog', 'first-post'] - assert_tag :tag => 'link', :attributes => { :rel => 'alternate', :type => 'application/rss+xml', :title => 'feed', :href => "http://#{environment.default_hostname}/testinguser/blog/feed" } + assert_tag :tag => 'link', :attributes => { :rel => 'alternate', :type => 'application/rss+xml', :title => 'Blog', :href => "http://#{environment.default_hostname}/testinguser/blog/feed" } end should 'hit the article when viewed' do diff --git a/test/unit/application_helper_test.rb b/test/unit/application_helper_test.rb index 5042554..9dc0cfd 100644 --- a/test/unit/application_helper_test.rb +++ b/test/unit/application_helper_test.rb @@ -237,14 +237,6 @@ class ApplicationHelperTest < Test::Unit::TestCase assert_nil select_categories(mock) end - should 'create rss feed link to blog' do - @controller = mock - @controller.stubs(:controller_name).returns('content_viewer') - p = create_user('testuser').person - b = Blog.create!(:profile => p, :name => 'blog_feed_test') - assert_tag_in_string meta_tags_for_article(b), :tag => 'link', :attributes => {:type => 'application/rss+xml', :title => 'feed'} - end - should 'provide sex icon for males' do stubs(:environment).returns(Environment.default) expects(:content_tag).with(anything, 'male').returns('MALE!!') -- libgit2 0.21.2