@@ -48,7 +48,8 class Project < ActiveRecord::Base | |||
|
48 | 48 | acts_as_customizable |
|
49 | 49 | acts_as_searchable :columns => ['name', 'description'], :project_key => 'id', :permission => nil |
|
50 | 50 | acts_as_event :title => Proc.new {|o| "#{l(:label_project)}: #{o.name}"}, |
|
51 | :url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}} | |
|
51 | :url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}}, | |
|
52 | :author => nil | |
|
52 | 53 | |
|
53 | 54 | attr_protected :status, :enabled_module_names |
|
54 | 55 |
@@ -42,6 +42,14 class ProjectsControllerTest < Test::Unit::TestCase | |||
|
42 | 42 | # Subproject in corresponding value |
|
43 | 43 | assert assigns(:project_tree)[Project.find(1)].include?(Project.find(3)) |
|
44 | 44 | end |
|
45 | ||
|
46 | def test_index_atom | |
|
47 | get :index, :format => 'atom' | |
|
48 | assert_response :success | |
|
49 | assert_template 'common/feed.atom.rxml' | |
|
50 | assert_select 'feed>title', :text => 'Redmine: Latest projects' | |
|
51 | assert_select 'feed>entry', :count => Project.count(:conditions => Project.visible_by(User.current)) | |
|
52 | end | |
|
45 | 53 | |
|
46 | 54 | def test_show_by_id |
|
47 | 55 | get :show, :id => 1 |
@@ -25,14 +25,15 module Redmine | |||
|
25 | 25 | module ClassMethods |
|
26 | 26 | def acts_as_event(options = {}) |
|
27 | 27 | return if self.included_modules.include?(Redmine::Acts::Event::InstanceMethods) |
|
28 |
options |
|
|
29 | options[:title] ||= :title | |
|
30 | options[:description] ||= :description | |
|
31 | options[:author] ||= :author | |
|
32 |
|
|
|
33 |
|
|
|
28 | default_options = { :datetime => :created_on, | |
|
29 | :title => :title, | |
|
30 | :description => :description, | |
|
31 | :author => :author, | |
|
32 | :url => {:controller => 'welcome'}, | |
|
33 | :type => self.name.underscore.dasherize } | |
|
34 | ||
|
34 | 35 | cattr_accessor :event_options |
|
35 |
self.event_options = options |
|
|
36 | self.event_options = default_options.merge(options) | |
|
36 | 37 | send :include, Redmine::Acts::Event::InstanceMethods |
|
37 | 38 | end |
|
38 | 39 | end |
General Comments 0
You need to be logged in to leave comments.
Login now