@@ -0,0 +1,43 | |||||
|
1 | Return-Path: <jsmith@somenet.foo> | |||
|
2 | Received: from osiris ([127.0.0.1]) | |||
|
3 | by OSIRIS | |||
|
4 | with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200 | |||
|
5 | Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris> | |||
|
6 | From: "John Smith" <jsmith@somenet.foo> | |||
|
7 | To: <redmine@somenet.foo> | |||
|
8 | Subject: New ticket on a given project | |||
|
9 | Date: Sun, 22 Jun 2008 12:28:07 +0200 | |||
|
10 | MIME-Version: 1.0 | |||
|
11 | Content-Type: text/plain; | |||
|
12 | format=flowed; | |||
|
13 | charset="iso-8859-1"; | |||
|
14 | reply-type=original | |||
|
15 | Content-Transfer-Encoding: 7bit | |||
|
16 | X-Priority: 3 | |||
|
17 | X-MSMail-Priority: Normal | |||
|
18 | X-Mailer: Microsoft Outlook Express 6.00.2900.2869 | |||
|
19 | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 | |||
|
20 | ||||
|
21 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas imperdiet | |||
|
22 | turpis et odio. Integer eget pede vel dolor euismod varius. Phasellus | |||
|
23 | blandit eleifend augue. Nulla facilisi. Duis id diam. Class aptent taciti | |||
|
24 | sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In | |||
|
25 | in urna sed tellus aliquet lobortis. Morbi scelerisque tortor in dolor. Cras | |||
|
26 | sagittis odio eu lacus. Aliquam sem tortor, consequat sit amet, vestibulum | |||
|
27 | id, iaculis at, lectus. Fusce tortor libero, congue ut, euismod nec, luctus | |||
|
28 | eget, eros. Pellentesque tortor enim, feugiat in, dignissim eget, tristique | |||
|
29 | sed, mauris. Pellentesque habitant morbi tristique senectus et netus et | |||
|
30 | malesuada fames ac turpis egestas. Quisque sit amet libero. In hac habitasse | |||
|
31 | platea dictumst. | |||
|
32 | ||||
|
33 | Nulla et nunc. Duis pede. Donec et ipsum. Nam ut dui tincidunt neque | |||
|
34 | sollicitudin iaculis. Duis vitae dolor. Vestibulum eget massa. Sed lorem. | |||
|
35 | Nullam volutpat cursus erat. Cras felis dolor, lacinia quis, rutrum et, | |||
|
36 | dictum et, ligula. Sed erat nibh, gravida in, accumsan non, placerat sed, | |||
|
37 | massa. Sed sodales, ante fermentum ultricies sollicitudin, massa leo | |||
|
38 | pulvinar dui, a gravida orci mi eget odio. Nunc a lacus. | |||
|
39 | ||||
|
40 | Project : onlinestore | |||
|
41 | Tracker: Feature request | |||
|
42 | category : Stock management | |||
|
43 | priority: Urgent |
@@ -65,6 +65,7 class NewsController < ApplicationController | |||||
65 | flash[:notice] = l(:label_comment_added) |
|
65 | flash[:notice] = l(:label_comment_added) | |
66 | redirect_to :action => 'show', :id => @news |
|
66 | redirect_to :action => 'show', :id => @news | |
67 | else |
|
67 | else | |
|
68 | show | |||
68 | render :action => 'show' |
|
69 | render :action => 'show' | |
69 | end |
|
70 | end | |
70 | end |
|
71 | end |
@@ -385,7 +385,7 module ApplicationHelper | |||||
385 | # export:some/file -> Force the download of the file |
|
385 | # export:some/file -> Force the download of the file | |
386 | # Forum messages: |
|
386 | # Forum messages: | |
387 | # message#1218 -> Link to message with id 1218 |
|
387 | # message#1218 -> Link to message with id 1218 | |
388 | text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|\s|<|$)}) do |m| |
|
388 | text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|,|\s|<|$)}) do |m| | |
389 | leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8 |
|
389 | leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8 | |
390 | link = nil |
|
390 | link = nil | |
391 | if esc.nil? |
|
391 | if esc.nil? |
@@ -168,7 +168,7 class MailHandler < ActionMailer::Base | |||||
168 | @keywords[attr] |
|
168 | @keywords[attr] | |
169 | else |
|
169 | else | |
170 | @keywords[attr] = begin |
|
170 | @keywords[attr] = begin | |
171 | if (options[:override] || @@handler_options[:allow_override].include?(attr.to_s)) && plain_text_body.gsub!(/^#{attr}:[ \t]*(.+)\s*$/i, '') |
|
171 | if (options[:override] || @@handler_options[:allow_override].include?(attr.to_s)) && plain_text_body.gsub!(/^#{attr}[ \t]*:[ \t]*(.+)\s*$/i, '') | |
172 | $1.strip |
|
172 | $1.strip | |
173 | elsif !@@handler_options[:issue][attr].blank? |
|
173 | elsif !@@handler_options[:issue][attr].blank? | |
174 | @@handler_options[:issue][attr] |
|
174 | @@handler_options[:issue][attr] |
@@ -2,7 +2,7 | |||||
2 |
|
2 | |||
3 | <ul> |
|
3 | <ul> | |
4 | <% @issues.each do |issue| -%> |
|
4 | <% @issues.each do |issue| -%> | |
5 | <li><%=h "#{issue.project} - #{issue.tracker} ##{issue.id}: #{issue.subject}" %></li> |
|
5 | <li><%=h issue.project %> - <%=link_to("#{issue.tracker} ##{issue.id}", :controller => 'issues', :action => 'show', :id => issue, :only_path => false)%>: <%=h issue.subject %></li> | |
6 | <% end -%> |
|
6 | <% end -%> | |
7 | </ul> |
|
7 | </ul> | |
8 |
|
8 |
@@ -20,11 +20,11 | |||||
20 | <% unless @pages.empty? %> |
|
20 | <% unless @pages.empty? %> | |
21 | <p class="other-formats"> |
|
21 | <p class="other-formats"> | |
22 | <%= l(:label_export_to) %> |
|
22 | <%= l(:label_export_to) %> | |
23 |
<span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_ |
|
23 | <span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span> | |
24 | <span><%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'html' %></span> |
|
24 | <span><%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'html' %></span> | |
25 | </p> |
|
25 | </p> | |
26 | <% end %> |
|
26 | <% end %> | |
27 |
|
27 | |||
28 | <% content_for :header_tags do %> |
|
28 | <% content_for :header_tags do %> | |
29 |
<%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :id => @project, :show_wiki_ |
|
29 | <%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %> | |
30 | <% end %> |
|
30 | <% end %> |
@@ -13,11 +13,11 | |||||
13 | <% unless @pages.empty? %> |
|
13 | <% unless @pages.empty? %> | |
14 | <p class="other-formats"> |
|
14 | <p class="other-formats"> | |
15 | <%= l(:label_export_to) %> |
|
15 | <%= l(:label_export_to) %> | |
16 |
<span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_ |
|
16 | <span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span> | |
17 | <span><%= link_to 'HTML', {:action => 'special', :page => 'export'} %></span> |
|
17 | <span><%= link_to 'HTML', {:action => 'special', :page => 'export'} %></span> | |
18 | </p> |
|
18 | </p> | |
19 | <% end %> |
|
19 | <% end %> | |
20 |
|
20 | |||
21 | <% content_for :header_tags do %> |
|
21 | <% content_for :header_tags do %> | |
22 |
<%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :id => @project, :show_wiki_ |
|
22 | <%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %> | |
23 | <% end %> |
|
23 | <% end %> |
@@ -7,6 +7,11 http://www.redmine.org/ | |||||
7 |
|
7 | |||
8 | == 2009-xx-xx v0.8.5 |
|
8 | == 2009-xx-xx v0.8.5 | |
9 |
|
9 | |||
|
10 | * Incoming mail handler : Allow spaces between keywords and colon | |||
|
11 | * Do not require a non-word character after a comma in Redmine links | |||
|
12 | * Include issue hyperlinks in reminder emails | |||
|
13 | * Fixed: 500 Internal Server Error is raised if add an empty comment to the news | |||
|
14 | * Fixes: Atom links for wiki pages are not correct | |||
10 | * Fixed: Atom feeds leak email address |
|
15 | * Fixed: Atom feeds leak email address | |
11 |
|
16 | |||
12 |
|
17 |
@@ -118,6 +118,15 class NewsControllerTest < Test::Unit::TestCase | |||||
118 | assert_equal User.find(2), comment.author |
|
118 | assert_equal User.find(2), comment.author | |
119 | end |
|
119 | end | |
120 |
|
120 | |||
|
121 | def test_empty_comment_should_not_be_added | |||
|
122 | @request.session[:user_id] = 2 | |||
|
123 | assert_no_difference 'Comment.count' do | |||
|
124 | post :add_comment, :id => 1, :comment => { :comments => '' } | |||
|
125 | assert_response :success | |||
|
126 | assert_template 'show' | |||
|
127 | end | |||
|
128 | end | |||
|
129 | ||||
121 | def test_destroy_comment |
|
130 | def test_destroy_comment | |
122 | comments_count = News.find(1).comments.size |
|
131 | comments_count = News.find(1).comments.size | |
123 | @request.session[:user_id] = 2 |
|
132 | @request.session[:user_id] = 2 |
@@ -122,6 +122,8 class ApplicationHelperTest < HelperTestCase | |||||
122 |
|
122 | |||
123 | changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1}, |
|
123 | changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1}, | |
124 | :class => 'changeset', :title => 'My very first commit') |
|
124 | :class => 'changeset', :title => 'My very first commit') | |
|
125 | changeset_link2 = link_to('r2', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 2}, | |||
|
126 | :class => 'changeset', :title => 'This commit fixes #1, #2 and references #1 & #3') | |||
125 |
|
127 | |||
126 | document_link = link_to('Test document', {:controller => 'documents', :action => 'show', :id => 1}, |
|
128 | document_link = link_to('Test document', {:controller => 'documents', :action => 'show', :id => 1}, | |
127 | :class => 'document') |
|
129 | :class => 'document') | |
@@ -139,6 +141,9 class ApplicationHelperTest < HelperTestCase | |||||
139 | '#3, #3 and #3.' => "#{issue_link}, #{issue_link} and #{issue_link}.", |
|
141 | '#3, #3 and #3.' => "#{issue_link}, #{issue_link} and #{issue_link}.", | |
140 | # changesets |
|
142 | # changesets | |
141 | 'r1' => changeset_link, |
|
143 | 'r1' => changeset_link, | |
|
144 | 'r1.' => "#{changeset_link}.", | |||
|
145 | 'r1, r2' => "#{changeset_link}, #{changeset_link2}", | |||
|
146 | 'r1,r2' => "#{changeset_link},#{changeset_link2}", | |||
142 | # documents |
|
147 | # documents | |
143 | 'document#1' => document_link, |
|
148 | 'document#1' => document_link, | |
144 | 'document:"Test document"' => document_link, |
|
149 | 'document:"Test document"' => document_link, |
@@ -92,6 +92,21 class MailHandlerTest < Test::Unit::TestCase | |||||
92 | assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.') |
|
92 | assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.') | |
93 | end |
|
93 | end | |
94 |
|
94 | |||
|
95 | def test_add_issue_with_spaces_between_attribute_and_separator | |||
|
96 | issue = submit_email('ticket_with_spaces_between_attribute_and_separator.eml', :allow_override => 'tracker,category,priority') | |||
|
97 | assert issue.is_a?(Issue) | |||
|
98 | assert !issue.new_record? | |||
|
99 | issue.reload | |||
|
100 | assert_equal 'New ticket on a given project', issue.subject | |||
|
101 | assert_equal User.find_by_login('jsmith'), issue.author | |||
|
102 | assert_equal Project.find(2), issue.project | |||
|
103 | assert_equal 'Feature request', issue.tracker.to_s | |||
|
104 | assert_equal 'Stock management', issue.category.to_s | |||
|
105 | assert_equal 'Urgent', issue.priority.to_s | |||
|
106 | assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.') | |||
|
107 | end | |||
|
108 | ||||
|
109 | ||||
95 | def test_add_issue_with_attachment_to_specific_project |
|
110 | def test_add_issue_with_attachment_to_specific_project | |
96 | issue = submit_email('ticket_with_attachment.eml', :issue => {:project => 'onlinestore'}) |
|
111 | issue = submit_email('ticket_with_attachment.eml', :issue => {:project => 'onlinestore'}) | |
97 | assert issue.is_a?(Issue) |
|
112 | assert issue.is_a?(Issue) |
General Comments 0
You need to be logged in to leave comments.
Login now