filesize: 28
filename: error281.txt
author_id: 2
+ description: An attachment
attachments_002:
created_on: 2007-01-27 15:08:27 +01:00
downloads: 0
assert_equal orig.project_id, copy.project_id
assert_equal orig.tracker_id, copy.tracker_id
assert_equal orig.status_id, copy.status_id
- assert_equal orig.assigned_to_id, copy.assigned_to_id
+ if orig.assigned_to_id
+ assert_equal orig.assigned_to_id, copy.assigned_to_id
+ else
+ assert_nil copy.assigned_to_id
+ end
assert_equal orig.priority_id, copy.priority_id
end
end
test "GET /issues/:id.xml should contains total_estimated_hours and total_spent_hours" do
parent = Issue.find(3)
+ parent.update_columns :estimated_hours => 2.0
child = Issue.generate!(:parent_issue_id => parent.id, :estimated_hours => 3.0)
TimeEntry.create!(:project => child.project, :issue => child, :user => child.author, :spent_on => child.author.today,
:hours => '2.5', :comments => '', :activity_id => TimeEntryActivity.first.id)
test "GET /issues/:id.xml should contains total_estimated_hours, and should not contains spent_hours and total_spent_hours when permission does not exists" do
parent = Issue.find(3)
+ parent.update_columns :estimated_hours => 2.0
child = Issue.generate!(:parent_issue_id => parent.id, :estimated_hours => 3.0)
# remove permission!
Role.anonymous.remove_permission! :view_time_entries
test "GET /issues/:id.json should contains total_estimated_hours and total_spent_hours" do
parent = Issue.find(3)
+ parent.update_columns :estimated_hours => 2.0
child = Issue.generate!(:parent_issue_id => parent.id, :estimated_hours => 3.0)
TimeEntry.create!(:project => child.project, :issue => child, :user => child.author, :spent_on => child.author.today,
:hours => '2.5', :comments => '', :activity_id => TimeEntryActivity.first.id)
test "GET /issues/:id.json should contains total_estimated_hours, and should not contains spent_hours and total_spent_hours when permission does not exists" do
parent = Issue.find(3)
+ parent.update_columns :estimated_hours => 2.0
child = Issue.generate!(:parent_issue_id => parent.id, :estimated_hours => 3.0)
# remove permission!
Role.anonymous.remove_permission! :view_time_entries
'Fr' => :fr,
'zh' => :zh,
'zh-tw' => :"zh-TW",
- 'zh-TW' => :"zh-TW",
- 'zh-ZZ' => nil }
+ 'zh-TW' => :"zh-TW"}
to_test.each {|lang, expected| assert_equal expected, find_language(lang)}
end
+ def test_find_language_with_invalid_language_should_return_nil
+ assert_nil find_language('zh-ZZ')
+ end
+
def test_fallback
::I18n.backend.store_translations(:en, {:untranslated => "Untranslated string"})
::I18n.locale = 'en'
class Redmine::MimeTypeTest < ActiveSupport::TestCase
def test_of
- to_test = {'test.unk' => nil,
- 'test.txt' => 'text/plain',
+ to_test = {'test.txt' => 'text/plain',
'test.c' => 'text/x-c',
}
to_test.each do |name, expected|
end
end
+ def test_of_with_unknown_type
+ assert_nil Redmine::MimeType.of('test.unk')
+ end
+
def test_css_class_of
- to_test = {'test.unk' => nil,
- 'test.txt' => 'text-plain',
+ to_test = {'test.txt' => 'text-plain',
'test.c' => 'text-x-c',
}
to_test.each do |name, expected|
end
end
+ def test_css_class_of_with_unknown_type
+ assert_nil Redmine::MimeType.css_class_of('test.unk')
+ end
+
def test_main_mimetype_of
- to_test = {'test.unk' => nil,
- 'test.txt' => 'text',
+ to_test = {'test.txt' => 'text',
'test.c' => 'text',
}
to_test.each do |name, expected|
end
end
+ def test_main_mimetype_of_with_unknown_type
+ assert_nil Redmine::MimeType.main_mimetype_of('test.unk')
+ end
+
def test_is_type
to_test = {['text', 'test.unk'] => false,
['text', 'test.txt'] => true,
end
def test_named_scope
- assert_equal Tracker.find_by_name('Feature'), Tracker.named('feature').first
+ assert_equal Tracker.find(2), Tracker.named('feature request').first
end
def test_visible_scope_chained_with_project_rolled_up_trackers