Class | RssControllerTest
In: | test/functional/rss_controller_test.rb
Parent: | Test::Unit::TestCase

### Methods

setup teardown test_list

### Public Instance methods

setup()

[Source]

        # File test/functional/rss_controller_test.rb, line 26
    26:   def setup
    27:     logger.debug "Test Case: #{name}"
    28:     @controller = RssController.new
    29:     @request    = ActionController::TestRequest.new
    30:     @response   = ActionController::TestResponse.new
    31:     @andy, @george, @tony = users(:andy), users(:george), users(:tony) # admin, cadmin, user
    32:   end

teardown()

[Source]

        # File test/functional/rss_controller_test.rb, line 34
    34:   def teardown
    35:     [ENV['EPFWIKI_SITES_PATH'], ENV['EPFWIKI_WIKIS_PATH']].each do |p|
    36:       FileUtils.rm_r(p) if File.exists?(p)
    37:       File.makedirs(p)
    38:     end
    39:   end

test_list()

[Source]

        # File test/functional/rss_controller_test.rb, line 41
    41:   def test_list
    42:     @wiki = create_templates
    43:     p = WikiPage.find_by_presentation_name('Toolmentor Template')
    44:     assert_not_nil p
    45:     for i in 0..2
    46:       c= Comment.new(:text => "Text of comment #{i} by user tony", :user => @tony, :version => p.current_version, :page => p, :site => p.site)
    47:       assert c.save
    48:       co = Checkout.new(:user => @andy, :page => p, :site => @wiki, :note => "Checkout #{i} by Andy")
    49:       assert co.save
    50:       co.checkin(@andy)
    51:       u = Upload.new(:filename => 'filename.html', :upload_type => 'Image',
    52:         :content_type => 'Content type', :description => 'Description of upload',
    53:         :user_id => @andy.id, :rel_path => 'x/y/z.html')
    54:       assert u.save
    55:     end
    56:     get :list, :site_folder => 'all'
    57:     assert_valid_feed
    58:     get :list, :site_folder => @wiki.folder
    59:     assert_valid_feed
    60:   end

[Validate]