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
This commit is contained in:
Vendored
+12
@@ -109,4 +109,16 @@ attachments_009:
|
||||
filename: version_file.zip
|
||||
author_id: 2
|
||||
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
|
||||
|
||||
Vendored
+7
@@ -13,4 +13,11 @@ journals_002:
|
||||
journalized_type: Issue
|
||||
user_id: 2
|
||||
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
|
||||
|
||||
@@ -255,6 +255,14 @@ class IssuesControllerTest < Test::Unit::TestCase
|
||||
:child => { :tag => 'legend',
|
||||
:content => /Notes/ } }
|
||||
end
|
||||
|
||||
def test_show_atom
|
||||
get :show, :id => 2, :format => 'atom'
|
||||
assert_response :success
|
||||
assert_template 'changes'
|
||||
# Inline image
|
||||
assert @response.body.include?("<img src=\"http://test.host/attachments/download/10\" alt=\"\" />")
|
||||
end
|
||||
|
||||
def test_show_export_to_pdf
|
||||
get :show, :id => 3, :format => 'pdf'
|
||||
|
||||
@@ -150,15 +150,17 @@ class QueryTest < Test::Unit::TestCase
|
||||
|
||||
def test_operator_contains
|
||||
query = Query.new(:project => Project.find(1), :name => '_')
|
||||
query.add_filter('subject', '~', ['string'])
|
||||
assert query.statement.include?("#{Issue.table_name}.subject LIKE '%string%'")
|
||||
find_issues_with_query(query)
|
||||
query.add_filter('subject', '~', ['uNable'])
|
||||
assert query.statement.include?("LOWER(#{Issue.table_name}.subject) LIKE '%unable%'")
|
||||
result = find_issues_with_query(query)
|
||||
assert result.empty?
|
||||
result.each {|issue| assert issue.subject.downcase.include?('unable') }
|
||||
end
|
||||
|
||||
def test_operator_does_not_contains
|
||||
query = Query.new(:project => Project.find(1), :name => '_')
|
||||
query.add_filter('subject', '!~', ['string'])
|
||||
assert query.statement.include?("#{Issue.table_name}.subject NOT LIKE '%string%'")
|
||||
query.add_filter('subject', '!~', ['uNable'])
|
||||
assert query.statement.include?("LOWER(#{Issue.table_name}.subject) NOT LIKE '%unable%'")
|
||||
find_issues_with_query(query)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user