parent
a635baf168
commit
14fe32ea27
@ -0,0 +1,60 @@ |
||||
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: <openproject@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. |
||||
|
||||
--- This line starts with a delimiter and should not be stripped |
||||
|
||||
This paragraph is before delimiters. |
||||
|
||||
BREAK |
||||
|
||||
This paragraph is between delimiters. |
||||
|
||||
--- |
||||
|
||||
This paragraph is after the delimiter so it shouldn't appear. |
||||
|
||||
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 |
||||
Status: Resolved |
||||
due date: 2010-12-31 |
||||
Start Date:2010-01-01 |
||||
Assigned to: A-Team |
||||
Version: alpha |
||||
estimated hours: 2.5 |
||||
done ratio: 30 |
||||
|
@ -1,17 +0,0 @@ |
||||
Return-Path: <john.doe@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> |
||||
To: <redmine@somenet.foo> |
||||
Subject: Ticket by unknown user |
||||
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 |
||||
|
||||
This is a ticket submitted by an unknown user. |
||||
|
@ -1,98 +0,0 @@ |
||||
#-- copyright |
||||
# OpenProject is an open source project management software. |
||||
# Copyright (C) 2012-2022 the OpenProject GmbH |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang |
||||
# Copyright (C) 2010-2013 the ChiliProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License |
||||
# as published by the Free Software Foundation; either version 2 |
||||
# of the License, or (at your option) any later version. |
||||
# |
||||
# This program is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with this program; if not, write to the Free Software |
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
# |
||||
# See COPYRIGHT and LICENSE files for more details. |
||||
#++ |
||||
require_relative '../../legacy_spec_helper' |
||||
|
||||
describe SortHelper, type: :helper do |
||||
include SortHelper |
||||
|
||||
before do |
||||
@session = nil |
||||
@sort_param = nil |
||||
end |
||||
|
||||
it 'default_sort_clause_with_arrays' do |
||||
sort_init 'attr1', 'desc' |
||||
sort_update(['attr1', 'attr2']) |
||||
|
||||
assert_equal 'attr1 DESC', sort_clause |
||||
end |
||||
|
||||
it 'default_sort_clause_with_hashes' do |
||||
sort_init 'attr1', 'desc' |
||||
sort_update('attr1' => 'table1.attr1', 'attr2' => 'table2.attr2') |
||||
|
||||
assert_equal 'table1.attr1 DESC', sort_clause |
||||
end |
||||
|
||||
it 'default_sort_clause_with_multiple_columnses' do |
||||
sort_init 'attr1', 'desc' |
||||
sort_update('attr1' => ['table1.attr1', 'table1.attr2'], 'attr2' => 'table2.attr2') |
||||
|
||||
assert_equal 'table1.attr1 DESC, table1.attr2 DESC', sort_clause |
||||
end |
||||
|
||||
it 'params_sorts' do |
||||
@sort_param = 'attr1,attr2:desc' |
||||
|
||||
sort_init 'attr1', 'desc' |
||||
sort_update('attr1' => 'table1.attr1', 'attr2' => 'table2.attr2') |
||||
|
||||
assert_equal 'table1.attr1, table2.attr2 DESC', sort_clause |
||||
assert_equal 'attr1,attr2:desc', @session['foo_bar_sort'] |
||||
end |
||||
|
||||
it 'invalid_params_sorts' do |
||||
@sort_param = 'invalid_key' |
||||
|
||||
sort_init 'attr1', 'desc' |
||||
sort_update('attr1' => 'table1.attr1', 'attr2' => 'table2.attr2') |
||||
|
||||
assert_equal 'table1.attr1 DESC', sort_clause |
||||
assert_equal 'attr1:desc', @session['foo_bar_sort'] |
||||
end |
||||
|
||||
it 'invalid_order_params_sorts' do |
||||
@sort_param = 'attr1:foo:bar,attr2' |
||||
|
||||
sort_init 'attr1', 'desc' |
||||
sort_update('attr1' => 'table1.attr1', 'attr2' => 'table2.attr2') |
||||
|
||||
assert_equal 'table1.attr1, table2.attr2', sort_clause |
||||
assert_equal 'attr1,attr2', @session['foo_bar_sort'] |
||||
end |
||||
|
||||
private |
||||
|
||||
def controller_name; 'foo'; end |
||||
|
||||
def action_name; 'bar'; end |
||||
|
||||
def params; { sort: @sort_param }; end |
||||
|
||||
def session; @session ||= {}; end |
||||
end |
Loading…
Reference in new issue