acts_as_customizable
acts_as_searchable :columns => ['name', 'description'], :project_key => 'id', :permission => nil
acts_as_event :title => Proc.new {|o| "#{l(:label_project)}: #{o.name}"},
- :url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}}
+ :url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}},
+ :author => nil
attr_protected :status, :enabled_module_names
# Subproject in corresponding value
assert assigns(:project_tree)[Project.find(1)].include?(Project.find(3))
end\r
+
+ def test_index_atom
+ get :index, :format => 'atom'
+ assert_response :success
+ assert_template 'common/feed.atom.rxml'
+ assert_select 'feed>title', :text => 'Redmine: Latest projects'
+ assert_select 'feed>entry', :count => Project.count(:conditions => Project.visible_by(User.current))
+ end
\r
def test_show_by_id\r
get :show, :id => 1\r
module ClassMethods
def acts_as_event(options = {})
return if self.included_modules.include?(Redmine::Acts::Event::InstanceMethods)
- options[:datetime] ||= :created_on
- options[:title] ||= :title
- options[:description] ||= :description
- options[:author] ||= :author
- options[:url] ||= {:controller => 'welcome'}
- options[:type] ||= self.name.underscore.dasherize
+ default_options = { :datetime => :created_on,
+ :title => :title,
+ :description => :description,
+ :author => :author,
+ :url => {:controller => 'welcome'},
+ :type => self.name.underscore.dasherize }
+
cattr_accessor :event_options
- self.event_options = options
+ self.event_options = default_options.merge(options)
send :include, Redmine::Acts::Event::InstanceMethods
end
end