Compare commits

...
12 Commits
Author SHA1 Message Date
Jean-Philippe Lang 0bdef7d797 tagged version 0.8.5
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/tags/0.8.5@2886 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-09-13 12:39:40 +00:00
Jean-Philippe Lang d884cc3870 CHANGELOG update
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2885 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-09-13 12:01:35 +00:00
Jean-Philippe Lang bdfee87349 Merged r2766 and r2783 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2884 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-09-13 11:58:48 +00:00
Jean-Philippe Lang 2ec385858f Merged r2722, r2771, r2772 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2883 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-09-13 11:53:27 +00:00
Jean-Philippe Lang 94488269d1 Merged r2768, r2773, r2774, r2775, r2796 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2882 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-09-13 11:46:39 +00:00
Jean-Philippe Lang 3d0fbea9fd Merged r2797, r2804, r2814, r2820, r2837, r2838 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2881 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-09-13 11:36:09 +00:00
Eric Davis 3d68b60063 Fixed a merge error in r2830, wrong hook variables where used.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2831 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-08-01 18:28:57 +00:00
Eric Davis 27b110a61b Merged r2829 from trunk
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2830 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-08-01 18:17:46 +00:00
Jean-Philippe Lang d6394b60a5 Merged r2794 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2795 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-06-28 11:57:04 +00:00
Eric Davis ffd720eec9 Merged r2790 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2791 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-06-14 16:23:56 +00:00
Jean-Philippe Lang 50c0cebe96 Merged r2763 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2764 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-05-25 18:14:15 +00:00
Jean-Philippe Lang 1342228771 Translations updates.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2753 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-05-17 14:05:55 +00:00
31 changed files with 203 additions and 24 deletions
+2
View File
@@ -46,6 +46,7 @@ class MessagesController < ApplicationController
@message.sticky = params[:message]['sticky'] @message.sticky = params[:message]['sticky']
end end
if request.post? && @message.save if request.post? && @message.save
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
attach_files(@message, params[:attachments]) attach_files(@message, params[:attachments])
redirect_to :action => 'show', :id => @message redirect_to :action => 'show', :id => @message
end end
@@ -58,6 +59,7 @@ class MessagesController < ApplicationController
@reply.board = @board @reply.board = @board
@topic.children << @reply @topic.children << @reply
if !@reply.new_record? if !@reply.new_record?
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
attach_files(@reply, params[:attachments]) attach_files(@reply, params[:attachments])
end end
redirect_to :action => 'show', :id => @topic redirect_to :action => 'show', :id => @topic
+1
View File
@@ -65,6 +65,7 @@ class NewsController < ApplicationController
flash[:notice] = l(:label_comment_added) flash[:notice] = l(:label_comment_added)
redirect_to :action => 'show', :id => @news redirect_to :action => 'show', :id => @news
else else
show
render :action => 'show' render :action => 'show'
end end
end end
+3
View File
@@ -197,6 +197,9 @@ class TimelogController < ApplicationController
render_403 and return if @time_entry && !@time_entry.editable_by?(User.current) render_403 and return if @time_entry && !@time_entry.editable_by?(User.current)
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today) @time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
@time_entry.attributes = params[:time_entry] @time_entry.attributes = params[:time_entry]
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
if request.post? and @time_entry.save if request.post? and @time_entry.save
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
redirect_back_or_default :action => 'details', :project_id => @time_entry.project redirect_back_or_default :action => 'details', :project_id => @time_entry.project
+1
View File
@@ -82,6 +82,7 @@ class WikiController < ApplicationController
@content.author = User.current @content.author = User.current
# if page is new @page.save will also save content, but not if page isn't a new record # if page is new @page.save will also save content, but not if page isn't a new record
if (@page.new_record? ? @page.save : @content.save) if (@page.new_record? ? @page.save : @content.save)
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
redirect_to :action => 'index', :id => @project, :page => @page.title redirect_to :action => 'index', :id => @project, :page => @page.title
end end
end end
+1 -1
View File
@@ -385,7 +385,7 @@ module ApplicationHelper
# export:some/file -> Force the download of the file # export:some/file -> Force the download of the file
# Forum messages: # Forum messages:
# message#1218 -> Link to message with id 1218 # message#1218 -> Link to message with id 1218
text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|\s|<|$)}) do |m| text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|,|\s|<|$)}) do |m|
leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8 leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8
link = nil link = nil
if esc.nil? if esc.nil?
+1 -1
View File
@@ -36,7 +36,7 @@ module WikiHelper
words_add += 1 words_add += 1
else else
del_at = pos unless del_at del_at = pos unless del_at
deleted << ' ' + change[2] deleted << ' ' + h(change[2])
words_del += 1 words_del += 1
end end
end end
+2
View File
@@ -112,6 +112,8 @@ class Changeset < ActiveRecord::Base
journal = issue.init_journal(user || User.anonymous, l(:text_status_changed_by_changeset, csettext)) journal = issue.init_journal(user || User.anonymous, l(:text_status_changed_by_changeset, csettext))
issue.status = fix_status issue.status = fix_status
issue.done_ratio = done_ratio if done_ratio issue.done_ratio = done_ratio if done_ratio
Redmine::Hook.call_hook(:model_changeset_scan_commit_for_issue_ids_pre_issue_update,
{ :changeset => self, :issue => issue })
issue.save issue.save
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated') Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
end end
+1 -1
View File
@@ -168,7 +168,7 @@ class MailHandler < ActionMailer::Base
@keywords[attr] @keywords[attr]
else else
@keywords[attr] = begin @keywords[attr] = begin
if (options[:override] || @@handler_options[:allow_override].include?(attr.to_s)) && plain_text_body.gsub!(/^#{attr}:[ \t]*(.+)\s*$/i, '') if (options[:override] || @@handler_options[:allow_override].include?(attr.to_s)) && plain_text_body.gsub!(/^#{attr}[ \t]*:[ \t]*(.+)\s*$/i, '')
$1.strip $1.strip
elsif !@@handler_options[:issue][attr].blank? elsif !@@handler_options[:issue][attr].blank?
@@handler_options[:issue][attr] @@handler_options[:issue][attr]
+2 -2
View File
@@ -368,9 +368,9 @@ class Query < ActiveRecord::Base
Time.now.at_beginning_of_week Time.now.at_beginning_of_week
sql = "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date(from), connection.quoted_date(from + 7.days)] sql = "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date(from), connection.quoted_date(from + 7.days)]
when "~" when "~"
sql = "#{db_table}.#{db_field} LIKE '%#{connection.quote_string(value.first)}%'" sql = "LOWER(#{db_table}.#{db_field}) LIKE '%#{connection.quote_string(value.first.to_s.downcase)}%'"
when "!~" when "!~"
sql = "#{db_table}.#{db_field} NOT LIKE '%#{connection.quote_string(value.first)}%'" sql = "LOWER(#{db_table}.#{db_field}) NOT LIKE '%#{connection.quote_string(value.first.to_s.downcase)}%'"
end end
return sql return sql
+2
View File
@@ -29,6 +29,7 @@
<% end %> <% end %>
</ul> </ul>
<% end %> <% end %>
<%= call_hook :view_account_left_bottom, :user => @user %>
</div> </div>
<div class="splitcontentright"> <div class="splitcontentright">
@@ -64,6 +65,7 @@
<%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :user_id => @user, :format => :atom, :key => User.current.rss_key) %> <%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :user_id => @user, :format => :atom, :key => User.current.rss_key) %>
<% end %> <% end %>
<% end %> <% end %>
<%= call_hook :view_account_right_bottom, :user => @user %>
</div> </div>
<% html_title @user.name %> <% html_title @user.name %>
+2 -2
View File
@@ -21,10 +21,10 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
author = item.event_author if item.respond_to?(:event_author) author = item.event_author if item.respond_to?(:event_author)
xml.author do xml.author do
xml.name(author) xml.name(author)
xml.email(author.mail) if author.respond_to?(:mail) && !author.mail.blank? xml.email(author.mail) if author.is_a?(User) && !author.mail.blank? && !author.pref.hide_mail
end if author end if author
xml.content "type" => "html" do xml.content "type" => "html" do
xml.text! textilizable(item.event_description) xml.text! textilizable(item, :event_description, :only_path => false)
end end
end end
end end
+2 -2
View File
@@ -15,7 +15,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.updated change.created_on.xmlschema xml.updated change.created_on.xmlschema
xml.author do xml.author do
xml.name change.user.name xml.name change.user.name
xml.email(change.user.mail) xml.email(change.user.mail) if change.user.is_a?(User) && !change.user.mail.blank? && !change.user.pref.hide_mail
end end
xml.content "type" => "html" do xml.content "type" => "html" do
xml.text! '<ul>' xml.text! '<ul>'
@@ -23,7 +23,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.text! '<li>' + show_detail(detail, false) + '</li>' xml.text! '<li>' + show_detail(detail, false) + '</li>'
end end
xml.text! '</ul>' xml.text! '</ul>'
xml.text! textilizable(change.notes) unless change.notes.blank? xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
end end
end end
end end
+1 -1
View File
@@ -2,7 +2,7 @@
<ul> <ul>
<% @issues.each do |issue| -%> <% @issues.each do |issue| -%>
<li><%=h "#{issue.project} - #{issue.tracker} ##{issue.id}: #{issue.subject}" %></li> <li><%=h issue.project %> - <%=link_to("#{issue.tracker} ##{issue.id}", :controller => 'issues', :action => 'show', :id => issue, :only_path => false)%>: <%=h issue.subject %></li>
<% end -%> <% end -%>
</ul> </ul>
+2
View File
@@ -4,6 +4,7 @@
<th><%= l(:label_project) %></th> <th><%= l(:label_project) %></th>
<th><%= l(:label_role) %></th> <th><%= l(:label_role) %></th>
<th style="width:15%"></th> <th style="width:15%"></th>
<%= call_hook(:view_users_memberships_table_header, :user => @user )%>
</thead> </thead>
<tbody> <tbody>
<% @memberships.each do |membership| %> <% @memberships.each do |membership| %>
@@ -19,6 +20,7 @@
<td align="center"> <td align="center">
<%= link_to l(:button_delete), {:action => 'destroy_membership', :id => @user, :membership_id => membership }, :method => :post, :class => 'icon icon-del' %> <%= link_to l(:button_delete), {:action => 'destroy_membership', :id => @user, :membership_id => membership }, :method => :post, :class => 'icon icon-del' %>
</td> </td>
<%= call_hook(:view_users_memberships_table_row, :user => @user, :membership => membership, :roles => @roles, :projects => @projects )%>
</tr> </tr>
</tbody> </tbody>
<% end; reset_cycle %> <% end; reset_cycle %>
+1
View File
@@ -1,5 +1,6 @@
<div class="contextual"> <div class="contextual">
<%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => @version}, :class => 'icon icon-edit' %> <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => @version}, :class => 'icon icon-edit' %>
<%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
</div> </div>
<h2><%= h(@version.name) %></h2> <h2><%= h(@version.name) %></h2>
+2 -2
View File
@@ -20,11 +20,11 @@
<% unless @pages.empty? %> <% unless @pages.empty? %>
<p class="other-formats"> <p class="other-formats">
<%= l(:label_export_to) %> <%= l(:label_export_to) %>
<span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_pages => 1, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span> <span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
<span><%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'html' %></span> <span><%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'html' %></span>
</p> </p>
<% end %> <% end %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :id => @project, :show_wiki_pages => 1, :format => 'atom', :key => User.current.rss_key) %> <%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
<% end %> <% end %>
+2 -2
View File
@@ -13,11 +13,11 @@
<% unless @pages.empty? %> <% unless @pages.empty? %>
<p class="other-formats"> <p class="other-formats">
<%= l(:label_export_to) %> <%= l(:label_export_to) %>
<span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_pages => 1, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span> <span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
<span><%= link_to 'HTML', {:action => 'special', :page => 'export'} %></span> <span><%= link_to 'HTML', {:action => 'special', :page => 'export'} %></span>
</p> </p>
<% end %> <% end %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :id => @project, :show_wiki_pages => 1, :format => 'atom', :key => User.current.rss_key) %> <%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
<% end %> <% end %>
@@ -0,0 +1,30 @@
# Copyright (c) 2009 Michael Koziarski <michael@koziarski.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
require 'bigdecimal'
alias BigDecimalUnsafe BigDecimal
# This fixes CVE-2009-1904 however it removes legitimate functionality that your
# application may depend on. You are *strongly* advised to upgrade your ruby
# rather than relying on this fix for an extended period of time.
def BigDecimal(initial, digits=0)
if initial.size > 255 || initial =~ /e/i
raise "Invalid big Decimal Value"
end
BigDecimalUnsafe(initial, digits)
end
+15
View File
@@ -5,6 +5,21 @@ Copyright (C) 2006-2009 Jean-Philippe Lang
http://www.redmine.org/ http://www.redmine.org/
== 2009-09-13 v0.8.5
* Incoming mail handler : Allow spaces between keywords and colon
* Do not require a non-word character after a comma in Redmine links
* Include issue hyperlinks in reminder emails
* Prevent nil error when retrieving svn version
* Various plugin hooks added
* Add plugins information to script/about
* Fixed: 500 Internal Server Error is raised if add an empty comment to the news
* Fixed: Atom links for wiki pages are not correct
* Fixed: Atom feeds leak email address
* Fixed: Case sensitivity in Issue filtering
* Fixed: When reading RSS feed, the inline-embedded images are not properly shown
== 2009-05-17 v0.8.4 == 2009-05-17 v0.8.4
* Allow textile mailto links * Allow textile mailto links
+3 -3
View File
@@ -681,6 +681,6 @@ text_user_mail_option: "De los proyectos no seleccionados, sólo recibirá notif
text_user_wrote: '%s escribió:' text_user_wrote: '%s escribió:'
text_wiki_destroy_confirmation: ¿Seguro que quiere borrar el wiki y todo su contenido? text_wiki_destroy_confirmation: ¿Seguro que quiere borrar el wiki y todo su contenido?
text_workflow_edit: Seleccionar un flujo de trabajo para actualizar text_workflow_edit: Seleccionar un flujo de trabajo para actualizar
text_plugin_assets_writable: Plugin assets directory writable text_plugin_assets_writable: Se puede escribir en el directorio de extensiones activas
warning_attachments_not_saved: "%d file(s) could not be saved." warning_attachments_not_saved: "No pudieron guardarse %d fichero(s)."
button_create_and_continue: Create and continue button_create_and_continue: Crear y continuar
+16
View File
@@ -0,0 +1,16 @@
module Redmine
class About
def self.print_plugin_info
plugins = Redmine::Plugin.registered_plugins
if !plugins.empty?
column_with = plugins.map {|internal_name, plugin| plugin.name.length}.max
puts "\nAbout your Redmine plugins"
plugins.each do |internal_name, plugin|
puts sprintf("%-#{column_with}s %s", plugin.name, plugin.version)
end
end
end
end
end
@@ -37,7 +37,7 @@ module Redmine
version = nil version = nil
shellout(cmd) do |io| shellout(cmd) do |io|
# Read svn version in first returned line # Read svn version in first returned line
if m = io.gets.match(%r{((\d+\.)+\d+)}) if m = io.gets.to_s.match(%r{((\d+\.)+\d+)})
version = m[0].scan(%r{\d+}).collect(&:to_i) version = m[0].scan(%r{\d+}).collect(&:to_i)
end end
end end
+4 -1
View File
@@ -1,3 +1,6 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot' require File.dirname(__FILE__) + '/../config/boot'
require 'commands/about' $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about'
Redmine::About.print_plugin_info
+12
View File
@@ -109,4 +109,16 @@ attachments_009:
filename: version_file.zip filename: version_file.zip
author_id: 2 author_id: 2
content_type: application/octet-stream content_type: application/octet-stream
attachments_010:
created_on: 2006-07-19 21:07:27 +02:00
container_type: Issue
container_id: 2
downloads: 0
disk_filename: 060719210727_picture.jpg
digest: b91e08d0cf966d5c6ff411bd8c4cc3a2
id: 10
filesize: 452
filename: picture.jpg
author_id: 2
content_type: image/jpeg
+7
View File
@@ -13,4 +13,11 @@ journals_002:
journalized_type: Issue journalized_type: Issue
user_id: 2 user_id: 2
journalized_id: 1 journalized_id: 1
journals_003:
created_on: <%= 1.days.ago.to_date.to_s(:db) %>
notes: "A comment with inline image: !picture.jpg!"
id: 3
journalized_type: Issue
user_id: 2
journalized_id: 2
@@ -0,0 +1,43 @@
Return-Path: <jsmith@somenet.foo>
Received: from osiris ([127.0.0.1])
by OSIRIS
with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
From: "John Smith" <jsmith@somenet.foo>
To: <redmine@somenet.foo>
Subject: New ticket on a given project
Date: Sun, 22 Jun 2008 12:28:07 +0200
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas imperdiet
turpis et odio. Integer eget pede vel dolor euismod varius. Phasellus
blandit eleifend augue. Nulla facilisi. Duis id diam. Class aptent taciti
sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In
in urna sed tellus aliquet lobortis. Morbi scelerisque tortor in dolor. Cras
sagittis odio eu lacus. Aliquam sem tortor, consequat sit amet, vestibulum
id, iaculis at, lectus. Fusce tortor libero, congue ut, euismod nec, luctus
eget, eros. Pellentesque tortor enim, feugiat in, dignissim eget, tristique
sed, mauris. Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. Quisque sit amet libero. In hac habitasse
platea dictumst.
Nulla et nunc. Duis pede. Donec et ipsum. Nam ut dui tincidunt neque
sollicitudin iaculis. Duis vitae dolor. Vestibulum eget massa. Sed lorem.
Nullam volutpat cursus erat. Cras felis dolor, lacinia quis, rutrum et,
dictum et, ligula. Sed erat nibh, gravida in, accumsan non, placerat sed,
massa. Sed sodales, ante fermentum ultricies sollicitudin, massa leo
pulvinar dui, a gravida orci mi eget odio. Nunc a lacus.
Project : onlinestore
Tracker: Feature request
category : Stock management
priority: Urgent
@@ -255,6 +255,14 @@ class IssuesControllerTest < Test::Unit::TestCase
:child => { :tag => 'legend', :child => { :tag => 'legend',
:content => /Notes/ } } :content => /Notes/ } }
end end
def test_show_atom
get :show, :id => 2, :format => 'atom'
assert_response :success
assert_template 'changes'
# Inline image
assert @response.body.include?("&lt;img src=\"http://test.host/attachments/download/10\" alt=\"\" /&gt;")
end
def test_show_export_to_pdf def test_show_export_to_pdf
get :show, :id => 3, :format => 'pdf' get :show, :id => 3, :format => 'pdf'
+9
View File
@@ -118,6 +118,15 @@ class NewsControllerTest < Test::Unit::TestCase
assert_equal User.find(2), comment.author assert_equal User.find(2), comment.author
end end
def test_empty_comment_should_not_be_added
@request.session[:user_id] = 2
assert_no_difference 'Comment.count' do
post :add_comment, :id => 1, :comment => { :comments => '' }
assert_response :success
assert_template 'show'
end
end
def test_destroy_comment def test_destroy_comment
comments_count = News.find(1).comments.size comments_count = News.find(1).comments.size
@request.session[:user_id] = 2 @request.session[:user_id] = 2
@@ -122,6 +122,8 @@ class ApplicationHelperTest < HelperTestCase
changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1}, changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1},
:class => 'changeset', :title => 'My very first commit') :class => 'changeset', :title => 'My very first commit')
changeset_link2 = link_to('r2', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 2},
:class => 'changeset', :title => 'This commit fixes #1, #2 and references #1 & #3')
document_link = link_to('Test document', {:controller => 'documents', :action => 'show', :id => 1}, document_link = link_to('Test document', {:controller => 'documents', :action => 'show', :id => 1},
:class => 'document') :class => 'document')
@@ -139,6 +141,9 @@ class ApplicationHelperTest < HelperTestCase
'#3, #3 and #3.' => "#{issue_link}, #{issue_link} and #{issue_link}.", '#3, #3 and #3.' => "#{issue_link}, #{issue_link} and #{issue_link}.",
# changesets # changesets
'r1' => changeset_link, 'r1' => changeset_link,
'r1.' => "#{changeset_link}.",
'r1, r2' => "#{changeset_link}, #{changeset_link2}",
'r1,r2' => "#{changeset_link},#{changeset_link2}",
# documents # documents
'document#1' => document_link, 'document#1' => document_link,
'document:"Test document"' => document_link, 'document:"Test document"' => document_link,
+15
View File
@@ -92,6 +92,21 @@ class MailHandlerTest < Test::Unit::TestCase
assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.') assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.')
end end
def test_add_issue_with_spaces_between_attribute_and_separator
issue = submit_email('ticket_with_spaces_between_attribute_and_separator.eml', :allow_override => 'tracker,category,priority')
assert issue.is_a?(Issue)
assert !issue.new_record?
issue.reload
assert_equal 'New ticket on a given project', issue.subject
assert_equal User.find_by_login('jsmith'), issue.author
assert_equal Project.find(2), issue.project
assert_equal 'Feature request', issue.tracker.to_s
assert_equal 'Stock management', issue.category.to_s
assert_equal 'Urgent', issue.priority.to_s
assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.')
end
def test_add_issue_with_attachment_to_specific_project def test_add_issue_with_attachment_to_specific_project
issue = submit_email('ticket_with_attachment.eml', :issue => {:project => 'onlinestore'}) issue = submit_email('ticket_with_attachment.eml', :issue => {:project => 'onlinestore'})
assert issue.is_a?(Issue) assert issue.is_a?(Issue)
+7 -5
View File
@@ -150,15 +150,17 @@ class QueryTest < Test::Unit::TestCase
def test_operator_contains def test_operator_contains
query = Query.new(:project => Project.find(1), :name => '_') query = Query.new(:project => Project.find(1), :name => '_')
query.add_filter('subject', '~', ['string']) query.add_filter('subject', '~', ['uNable'])
assert query.statement.include?("#{Issue.table_name}.subject LIKE '%string%'") assert query.statement.include?("LOWER(#{Issue.table_name}.subject) LIKE '%unable%'")
find_issues_with_query(query) result = find_issues_with_query(query)
assert result.empty?
result.each {|issue| assert issue.subject.downcase.include?('unable') }
end end
def test_operator_does_not_contains def test_operator_does_not_contains
query = Query.new(:project => Project.find(1), :name => '_') query = Query.new(:project => Project.find(1), :name => '_')
query.add_filter('subject', '!~', ['string']) query.add_filter('subject', '!~', ['uNable'])
assert query.statement.include?("#{Issue.table_name}.subject NOT LIKE '%string%'") assert query.statement.include?("LOWER(#{Issue.table_name}.subject) NOT LIKE '%unable%'")
find_issues_with_query(query) find_issues_with_query(query)
end end