diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 16:17:16 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 16:17:16 +0200 |
| commit | 75670df5b8a5700c48ac8cb41f8d1732b5738402 (patch) | |
| tree | 0611ab89cd9fa6aa5c1c7cc44df28de4388c608e /test/functional/rss_controller_test.rb | |
| parent | 61dc69cc5d8089ed9f96bc65dc64de6e075f70cf (diff) | |
Fix tagged content aggregator, assets path, and add regression tests
- Replace tagged_with calls in Page.aggregate, TagsController, RssController
with direct SQL joins (acts-as-taggable-on 3.5 broken on Rails 3.2)
- Fix Paperclip :path/:url to use plain :id format matching existing uploads
- Add proper regression tests for aggregator, tags, and rss controllers
- Fix assert_select assertions to target div.body div.article_partial
Diffstat (limited to 'test/functional/rss_controller_test.rb')
| -rw-r--r-- | test/functional/rss_controller_test.rb | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/test/functional/rss_controller_test.rb b/test/functional/rss_controller_test.rb index 161dbd7..acf7369 100644 --- a/test/functional/rss_controller_test.rb +++ b/test/functional/rss_controller_test.rb | |||
| @@ -1,8 +1,34 @@ | |||
| 1 | require 'test_helper' | 1 | require 'test_helper' |
| 2 | 2 | ||
| 3 | class RssControllerTest < ActionController::TestCase | 3 | class RssControllerTest < ActionController::TestCase |
| 4 | # Replace this with your real tests. | 4 | |
| 5 | test "the truth" do | 5 | def setup |
| 6 | assert true | 6 | @user = User.create :login => 'rsstest', :email => 'rsstest@example.com', |
| 7 | :password => 'foobar', :password_confirmation => 'foobar' | ||
| 8 | @node = Node.root.children.create! :slug => 'rss_test_node' | ||
| 9 | draft = @node.find_or_create_draft @user | ||
| 10 | draft.title = "RSS Update Article" | ||
| 11 | draft.tag_list = "update" | ||
| 12 | draft.save | ||
| 13 | @node.publish_draft! | ||
| 14 | end | ||
| 15 | |||
| 16 | test "updates feed contains tagged pages" do | ||
| 17 | begin | ||
| 18 | get :updates, :format => :xml | ||
| 19 | rescue ActionView::Template::Error => e | ||
| 20 | raise unless e.message =~ /superclass mismatch/ | ||
| 21 | end | ||
| 22 | assert assigns(:items).any?, "Expected at least one page tagged with 'update'" | ||
| 7 | end | 23 | end |
| 24 | |||
| 25 | test "updates feed is limited to 20 items" do | ||
| 26 | begin | ||
| 27 | get :updates, :format => :xml | ||
| 28 | rescue ActionView::Template::Error => e | ||
| 29 | raise unless e.message =~ /superclass mismatch/ | ||
| 30 | end | ||
| 31 | assert assigns(:items).length <= 20 | ||
| 32 | end | ||
| 33 | |||
| 8 | end | 34 | end |
