menu_item :settings, :only => :settings
menu_item :issues, :only => [:changelog]
- before_filter :find_project, :except => [ :index, :list, :add ]
- before_filter :authorize, :except => [ :index, :list, :add, :archive, :unarchive, :destroy ]
+ before_filter :find_project, :except => [ :index, :list, :add, :activity ]
+ before_filter :find_optional_project, :only => :activity
+ before_filter :authorize, :except => [ :index, :list, :add, :archive, :unarchive, :destroy, :activity ]
before_filter :require_admin, :only => [ :add, :archive, :unarchive, :destroy ]
accept_key_auth :activity, :calendar
@date_from = @date_to - @days
@event_types = %w(issues news files documents changesets wiki_pages messages)
- @event_types.delete('wiki_pages') unless @project.wiki
- @event_types.delete('changesets') unless @project.repository
- @event_types.delete('messages') unless @project.boards.any?
- # only show what the user is allowed to view
- @event_types = @event_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, @project)}
-
+ if @project
+ @event_types.delete('wiki_pages') unless @project.wiki
+ @event_types.delete('changesets') unless @project.repository
+ @event_types.delete('messages') unless @project.boards.any?
+ # only show what the user is allowed to view
+ @event_types = @event_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, @project)}
+ @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
+ end
@scope = @event_types.select {|t| params["show_#{t}"]}
# default events if none is specified in parameters
@scope = (@event_types - %w(wiki_pages messages))if @scope.empty?
@events = []
if @scope.include?('issues')
- @events += @project.issues.find(:all, :include => [:author, :tracker], :conditions => ["#{Issue.table_name}.created_on>=? and #{Issue.table_name}.created_on<=?", @date_from, @date_to] )
- @events += @project.issues_status_changes(@date_from, @date_to)
+ cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_issues, :project => @project, :with_subprojects => @with_subprojects))
+ cond.add(["#{Issue.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
+ @events += Issue.find(:all, :include => [:project, :author, :tracker], :conditions => cond.conditions)
+
+ cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_issues, :project => @project, :with_subprojects => @with_subprojects))
+ cond.add(["#{Journal.table_name}.journalized_type = 'Issue' AND #{JournalDetail.table_name}.prop_key = 'status_id' AND #{Journal.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
+ @events += Journal.find(:all, :include => [{:issue => :project}, :details, :user], :conditions => cond.conditions)
end
if @scope.include?('news')
- @events += @project.news.find(:all, :conditions => ["#{News.table_name}.created_on>=? and #{News.table_name}.created_on<=?", @date_from, @date_to], :include => :author )
+ cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_news, :project => @project, :with_subprojects => @with_subprojects))
+ cond.add(["#{News.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
+ @events += News.find(:all, :include => [:project, :author], :conditions => cond.conditions)
end
if @scope.include?('files')
- @events += Attachment.find(:all, :select => "#{Attachment.table_name}.*", :joins => "LEFT JOIN #{Version.table_name} ON #{Version.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Version' and #{Version.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author )
+ cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_files, :project => @project, :with_subprojects => @with_subprojects))
+ cond.add(["#{Attachment.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
+ @events += Attachment.find(:all, :select => "#{Attachment.table_name}.*",
+ :joins => "LEFT JOIN #{Version.table_name} ON #{Attachment.table_name}.container_type='Version' AND #{Version.table_name}.id = #{Attachment.table_name}.container_id " +
+ "LEFT JOIN #{Project.table_name} ON #{Version.table_name}.project_id = #{Project.table_name}.id",
+ :conditions => cond.conditions)
end
if @scope.include?('documents')
- @events += @project.documents.find(:all, :conditions => ["#{Document.table_name}.created_on>=? and #{Document.table_name}.created_on<=?", @date_from, @date_to] )
- @events += Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN #{Document.table_name} ON #{Document.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Document' and #{Document.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author )
+ cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_documents, :project => @project, :with_subprojects => @with_subprojects))
+ cond.add(["#{Document.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
+ @events += Document.find(:all, :include => :project, :conditions => cond.conditions)
+
+ cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_documents, :project => @project, :with_subprojects => @with_subprojects))
+ cond.add(["#{Attachment.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
+ @events += Attachment.find(:all, :select => "#{Attachment.table_name}.*",
+ :joins => "LEFT JOIN #{Document.table_name} ON #{Attachment.table_name}.container_type='Document' AND #{Document.table_name}.id = #{Attachment.table_name}.container_id " +
+ "LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id",
+ :conditions => cond.conditions)
end
if @scope.include?('wiki_pages')
"#{WikiContent.versioned_table_name}.page_id, #{WikiContent.versioned_table_name}.author_id, " +
"#{WikiContent.versioned_table_name}.id"
joins = "LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiContent.versioned_table_name}.page_id " +
- "LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id "
- conditions = ["#{Wiki.table_name}.project_id = ? AND #{WikiContent.versioned_table_name}.updated_on BETWEEN ? AND ?",
- @project.id, @date_from, @date_to]
+ "LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id " +
+ "LEFT JOIN #{Project.table_name} ON #{Project.table_name}.id = #{Wiki.table_name}.project_id"
- @events += WikiContent.versioned_class.find(:all, :select => select, :joins => joins, :conditions => conditions)
+ cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_wiki_pages, :project => @project, :with_subprojects => @with_subprojects))
+ cond.add(["#{WikiContent.versioned_table_name}.updated_on BETWEEN ? AND ?", @date_from, @date_to])
+ @events += WikiContent.versioned_class.find(:all, :select => select, :joins => joins, :conditions => cond.conditions)
end
if @scope.include?('changesets')
- @events += Changeset.find(:all, :include => :repository, :conditions => ["#{Repository.table_name}.project_id = ? AND #{Changeset.table_name}.committed_on BETWEEN ? AND ?", @project.id, @date_from, @date_to])
+ cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_changesets, :project => @project, :with_subprojects => @with_subprojects))
+ cond.add(["#{Changeset.table_name}.committed_on BETWEEN ? AND ?", @date_from, @date_to])
+ @events += Changeset.find(:all, :include => {:repository => :project}, :conditions => cond.conditions)
end
if @scope.include?('messages')
- @events += Message.find(:all,
- :include => [:board, :author],
- :conditions => ["#{Board.table_name}.project_id=? AND #{Message.table_name}.created_on BETWEEN ? AND ?", @project.id, @date_from, @date_to])
+ cond = ARCondition.new(Project.allowed_to_condition(User.current, :view_messages, :project => @project, :with_subprojects => @with_subprojects))
+ cond.add(["#{Message.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to])
+ @events += Message.find(:all, :include => [{:board => :project}, :author], :conditions => cond.conditions)
end
@events_by_day = @events.group_by(&:event_date)
respond_to do |format|
format.html { render :layout => false if request.xhr? }
- format.atom { render_feed(@events, :title => "#{@project.name}: #{l(:label_activity)}") }
+ format.atom { render_feed(@events, :title => "#{@project || Setting.app_title}: #{l(:label_activity)}") }
end
end
render_404
end
+ def find_optional_project
+ return true unless params[:id]
+ @project = Project.find(params[:id])
+ authorize
+ rescue ActiveRecord::RecordNotFound
+ render_404
+ end
+
def retrieve_selected_tracker_ids(selectable_trackers)
if ids = params[:tracker_ids]
@selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s }
validates_length_of :disk_filename, :maximum => 255
acts_as_event :title => :filename,
- :description => :filename,
:url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id}}
cattr_accessor :storage_path
super
end
+ def project
+ repository.project
+ end
+
def after_create
scan_comment_for_issue_ids
end
end
end
- # Return all issues status changes for the project between the 2 given dates
- def issues_status_changes(from, to)
- Journal.find(:all, :include => [:issue, :details, :user],
- :conditions => ["#{Journal.table_name}.journalized_type = 'Issue'" +
- " AND #{Issue.table_name}.project_id = ?" +
- " AND #{JournalDetail.table_name}.prop_key = 'status_id'" +
- " AND #{Journal.table_name}.created_on BETWEEN ? AND ?",
- id, from, to+1])
- end
-
# returns latest created projects
# non public projects will be returned only if user is a member of those
def self.latest(user=nil, count=5)
end
end
- def self.allowed_to_condition(user, permission)
+ def self.allowed_to_condition(user, permission, options={})
statements = []
- active_statement = "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
+ base_statement = "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
+ if options[:project]
+ project_statement = "#{Project.table_name}.id = #{options[:project].id}"
+ project_statement << " OR #{Project.table_name}.parent_id = #{options[:project].id}" if options[:with_subprojects]
+ base_statement = "(#{project_statement}) AND (#{base_statement})"
+ end
if user.admin?
# no restriction
elsif user.logged?
statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.non_member.allowed_to?(permission)
allowed_project_ids = user.memberships.select {|m| m.role.allowed_to?(permission)}.collect {|m| m.project_id}
statements << "#{Project.table_name}.id IN (#{allowed_project_ids.join(',')})" if allowed_project_ids.any?
+ elsif Role.anonymous.allowed_to?(permission)
+ # anonymous user allowed on public project
+ statements << "#{Project.table_name}.is_public = #{connection.quoted_true}"
else
- statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.anonymous.allowed_to?(permission)
+ # anonymous user is not authorized
+ statements << "1=0"
end
- statements.empty? ? active_statement : "(#{active_statement} AND (#{statements.join(' OR ')}))"
+ statements.empty? ? base_statement : "((#{base_statement}) AND (#{statements.join(' OR ')}))"
end
def self.find(*args)
end
end
+ def project
+ page.project
+ end
+
# Returns the previous version or nil
def previous
@previous ||= WikiContent::Version.find(:first,
xml.generator(:uri => Redmine::Info.url, :version => Redmine::VERSION) { xml.text! Redmine::Info.versioned_name; }
@items.each do |item|
xml.entry do
+ url = url_for(item.event_url(:only_path => false))
xml.title truncate(item.event_title, 100)
- xml.link "rel" => "alternate", "href" => url_for(item.event_url(:only_path => false))
- xml.id url_for(item.event_url(:only_path => false))
+ xml.link "rel" => "alternate", "href" => url
+ xml.id url
xml.updated item.event_datetime.xmlschema
author = item.event_author if item.respond_to?(:author)
xml.author do
<dl>
<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
<dt class="<%= e.class.name.downcase %>"><span class="time"><%= format_time(e.event_datetime, false) %></span>
- <%= link_to h(truncate(e.event_title, 100)), e.event_url %></dt>
+ <%= content_tag('span', h(e.project), :class => 'project') if @project.nil? || @project != e.project %> <%= link_to h(truncate(e.event_title, 100)), e.event_url %></dt>
<dd><% unless e.event_description.blank? -%>
<span class="description"><%= format_activity_description(e.event_description) %></span><br />
<% end %>
</p>
<% content_for :header_tags do %>
-<%= auto_discovery_link_tag(:atom, params.merge(:format => 'atom', :year => nil, :month => nil, :key => User.current.rss_key).delete_if{|k,v|k=="commit"}) %>
+<%= auto_discovery_link_tag(:atom, params.merge(:format => 'atom', :year => nil, :month => nil, :key => User.current.rss_key)) %>
<% end %>
<% content_for :sidebar do %>
-<% form_tag do %>
+<% form_tag({}, :method => :get) do %>
<h3><%= l(:label_activity) %></h3>
<p><% @event_types.each do |t| %>
<label><%= check_box_tag "show_#{t}", 1, @scope.include?(t) %> <%= l("label_#{t.singularize}_plural")%></label><br />
<% end %></p>
-<p><%= submit_tag l(:button_apply), :class => 'button-small' %></p>
+<% if @project && @project.active_children.any? %>
+ <p><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label></p>
+ <%= hidden_field_tag 'with_subprojects', 0 %>
+<% end %>
+<p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p>
<% end %>
<% end %>
+<div class="contextual">
+ <%= link_to l(:label_issue_view_all), { :controller => 'issues' } %> |
+ <%= link_to l(:label_overall_activity), { :controller => 'projects', :action => 'activity' }%>
+</div>
+
<h2><%=l(:label_project_plural)%></h2>
<% @project_tree.keys.sort.each do |project| %>
</div>
<% content_for :header_tags do %>
-<%= auto_discovery_link_tag(:atom, {:controller => 'news', :action => 'index', :key => User.current.rss_key, :format => 'atom'}, {:title => l(:label_news_latest)}) %>
+<%= auto_discovery_link_tag(:atom, {:controller => 'news', :action => 'index', :key => User.current.rss_key, :format => 'atom'},
+ :title => "#{Setting.app_title}: #{l(:label_news_latest)}") %>
+<%= auto_discovery_link_tag(:atom, {:controller => 'projects', :action => 'activity', :key => User.current.rss_key, :format => 'atom'},
+ :title => "#{Setting.app_title}: #{l(:label_activity)}") %>
<% end %>
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
text_reassign_time_entries: 'Reassign reported hours to this issue:'
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_last_updates_plural: %d last updated
label_registered_on: Registered on
label_activity: Activity
+label_overall_activity: Overall activity
label_new: New
label_logged_as: Logged as
label_environment: Environment
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
field_comments_sorting: Display comments
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+label_overall_activity: Overall activity
field_subproject: Sous-projet
field_hours: Heures
field_activity: Activité
+label_overall_activity: Activité globale
field_spent_on: Date
field_identifier: Identifiant
field_is_filter: Utilisé comme filtre
label_start_to_end: début à fin
label_stay_logged_in: Rester connecté
label_disabled: désactivé
-label_show_completed_versions: Voire les versions passées
+label_show_completed_versions: Voir les versions passées
label_me: moi
label_board: Forum
label_board_new: Nouveau forum
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
field_comments_sorting: Display comments
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order\r
label_preferences: Preferences\r
setting_display_subprojects_issues: Display subprojects issues on main projects by default\r
+label_overall_activity: Overall activity\r
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
label_reverse_chronological_order: In reverse chronological order
label_preferences: Preferences
setting_display_subprojects_issues: Display subprojects issues on main projects by default
+label_overall_activity: Overall activity
enumeration_issue_priorities: 項目優先權
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (time tracking)
+label_overall_activity: Overall activity
enumeration_issue_priorities: 问题优先级
enumeration_doc_categories: 文档类别
enumeration_activities: 活动(时间跟踪)
+label_overall_activity: Overall activity
def initialize(condition=nil)
@conditions = ['1=1']
- @conditions.add(condition) if condition
+ add(condition) if condition
end
def add(condition)
div#activity dt { margin-bottom: 1px; }
div#activity dt .time { color: #777; font-size: 80%; }
div#activity dd .description { font-style: italic; }
+div#activity span.project:after { content: " -"; }
div#roadmap fieldset.related-issues { margin-bottom: 1em; }
div#roadmap fieldset.related-issues ul { margin-top: 0.3em; margin-bottom: 0.3em; }
start_date: <%= 1.day.from_now.to_date.to_s(:db) %>\r
due_date: <%= 40.day.ago.to_date.to_s(:db) %>\r
issues_004: \r
- created_on: 2006-07-19 21:07:27 +02:00\r
+ created_on: <%= 5.days.ago.to_date.to_s(:db) %>\r
project_id: 2\r
- updated_on: 2006-07-19 21:07:27 +02:00\r
+ updated_on: <%= 2.days.ago.to_date.to_s(:db) %>\r
priority_id: 4\r
subject: Issue on project 2\r
id: 4\r
assigned_to_id: \r
author_id: 2\r
status_id: 1\r
+issues_005: \r
+ created_on: <%= 5.days.ago.to_date.to_s(:db) %>\r
+ project_id: 3\r
+ updated_on: <%= 2.days.ago.to_date.to_s(:db) %>\r
+ priority_id: 4\r
+ subject: Subproject issue\r
+ id: 5\r
+ fixed_version_id: \r
+ category_id: \r
+ description: This is an issue on a cookbook subproject\r
+ tracker_id: 1\r
+ assigned_to_id: \r
+ author_id: 2\r
+ status_id: 1\r
\r
parent_id: \r
board_id: 1\r
messages_005: \r
- created_on: 2007-09-12 17:18:00 +02:00\r
- updated_on: 2007-09-12 17:18:00 +02:00\r
+ created_on: <%= 3.days.ago.to_date.to_s(:db) %>\r
+ updated_on: <%= 3.days.ago.to_date.to_s(:db) %>\r
subject: 'RE: post 2'\r
id: 5\r
replies_count: 0\r
class ProjectsController; def rescue_action(e) raise e end; end
class ProjectsControllerTest < Test::Unit::TestCase
- fixtures :projects, :versions, :users, :roles, :members, :issues, :journals, :journal_details, :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations
+ fixtures :projects, :versions, :users, :roles, :members, :issues, :journals, :journal_details,
+ :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages
def setup
@controller = ProjectsController.new
assert assigns(:versions).include?(Version.find(1))
end
- def test_activity
- get :activity, :id => 1
+ def test_project_activity
+ get :activity, :id => 1, :with_subprojects => 0
assert_response :success
assert_template 'activity'
assert_not_nil assigns(:events_by_day)
+ assert_not_nil assigns(:events)
+
+ # subproject issue not included by default
+ assert !assigns(:events).include?(Issue.find(5))
assert_tag :tag => "h3",
:content => /#{2.days.ago.to_date.day}/,
}
end
+ def test_activity_with_subprojects
+ get :activity, :id => 1, :with_subprojects => 1
+ assert_response :success
+ assert_template 'activity'
+ assert_not_nil assigns(:events)
+
+ assert assigns(:events).include?(Issue.find(1))
+ assert !assigns(:events).include?(Issue.find(4))
+ # subproject issue
+ assert assigns(:events).include?(Issue.find(5))
+ end
+
+ def test_global_activity_anonymous
+ get :activity
+ assert_response :success
+ assert_template 'activity'
+ assert_not_nil assigns(:events)
+
+ assert assigns(:events).include?(Issue.find(1))
+ # Issue of a private project
+ assert !assigns(:events).include?(Issue.find(4))
+ end
+
+ def test_global_activity_logged_user
+ @request.session[:user_id] = 2 # manager
+ get :activity
+ assert_response :success
+ assert_template 'activity'
+ assert_not_nil assigns(:events)
+
+ assert assigns(:events).include?(Issue.find(1))
+ # Issue of a private project the user belongs to
+ assert assigns(:events).include?(Issue.find(4))
+ end
+
+
+ def test_global_activity_with_all_types
+ get :activity, :show_issues => 1, :show_news => 1, :show_files => 1, :show_documents => 1, :show_changesets => 1, :show_wiki_pages => 1, :show_messages => 1
+ assert_response :success
+ assert_template 'activity'
+ assert_not_nil assigns(:events)
+
+ assert assigns(:events).include?(Issue.find(1))
+ assert !assigns(:events).include?(Issue.find(4))
+ assert assigns(:events).include?(Message.find(5))
+ end
+
def test_calendar
get :calendar, :id => 1
assert_response :success
assert_equal [1, 2, 3], parent.rolled_up_trackers.collect(&:id)\r
assert_equal [2, 3], child.rolled_up_trackers.collect(&:id)\r
end\r
-\r
- def test_issues_status_changes\r
- journals = @ecookbook.issues_status_changes 3.days.ago.to_date, Date.today\r
- assert_equal 1, journals.size\r
- assert_kind_of Journal, journals.first\r
- \r
- journals = @ecookbook.issues_status_changes 30.days.ago.to_date, 10.days.ago.to_date\r
- assert_equal 0, journals.size\r
- end\r
end\r