Feature #1014 » allow_empty_descriptions-1014.diff
| app/models/issue.rb | ||
|---|---|---|
|
acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id}: #{o.subject}"},
|
||
|
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.id}}
|
||
|
|
||
|
validates_presence_of :subject, :description, :priority, :project, :tracker, :author, :status
|
||
|
validates_presence_of :subject, :priority, :project, :tracker, :author, :status
|
||
|
validates_length_of :subject, :maximum => 255
|
||
|
validates_inclusion_of :done_ratio, :in => 0..100
|
||
|
validates_numericality_of :estimated_hours, :allow_nil => true
|
||
| app/views/issues/_form.rhtml | ||
|---|---|---|
|
<div id="issue_descr_fields" <%= 'style="display:none"' unless @issue.new_record? || @issue.errors.any? %>>
|
||
|
<p><%= f.text_field :subject, :size => 80, :required => true %></p>
|
||
|
<p><%= f.text_area :description, :required => true,
|
||
|
<p><%= f.text_area :description,
|
||
|
:cols => 60,
|
||
|
:rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min),
|
||
|
:accesskey => accesskey(:edit),
|
||
| test/unit/issue_test.rb | ||
|---|---|---|
|
issue.reload
|
||
|
assert_equal 1.5, issue.estimated_hours
|
||
|
end
|
||
|
def test_create_with_empty_description
|
||
|
issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'test_create', :estimated_hours => '1:30')
|
||
|
assert issue.save
|
||
|
end
|
||
|
|
||
|
def test_category_based_assignment
|
||
|
issue = Issue.create(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'Assignment test', :description => 'Assignment test', :category_id => 1)
|
||