@@ -45,7 +45,7 class Issue < ActiveRecord::Base | |||
|
45 | 45 | acts_as_activity_provider :find_options => {:include => [:project, :author, :tracker]}, |
|
46 | 46 | :author_key => :author_id |
|
47 | 47 | |
|
48 |
validates_presence_of :subject |
|
|
48 | validates_presence_of :subject, :priority, :project, :tracker, :author, :status | |
|
49 | 49 | validates_length_of :subject, :maximum => 255 |
|
50 | 50 | validates_inclusion_of :done_ratio, :in => 0..100 |
|
51 | 51 | validates_numericality_of :estimated_hours, :allow_nil => true |
@@ -8,7 +8,7 | |||
|
8 | 8 | |
|
9 | 9 | <div id="issue_descr_fields" <%= 'style="display:none"' unless @issue.new_record? || @issue.errors.any? %>> |
|
10 | 10 | <p><%= f.text_field :subject, :size => 80, :required => true %></p> |
|
11 |
<p><%= f.text_area :description, |
|
|
11 | <p><%= f.text_area :description, | |
|
12 | 12 | :cols => 60, |
|
13 | 13 | :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), |
|
14 | 14 | :accesskey => accesskey(:edit), |
@@ -59,7 +59,7 end %> | |||
|
59 | 59 | <hr /> |
|
60 | 60 | |
|
61 | 61 | <div class="contextual"> |
|
62 |
<%= link_to_remote_if_authorized |
|
|
62 | <%= link_to_remote_if_authorized(l(:button_quote), { :url => {:action => 'reply', :id => @issue} }, :class => 'icon icon-comment') unless @issue.description.blank? %> | |
|
63 | 63 | </div> |
|
64 | 64 | |
|
65 | 65 | <p><strong><%=l(:field_description)%></strong></p> |
@@ -33,6 +33,12 class IssueTest < Test::Unit::TestCase | |||
|
33 | 33 | assert_equal 1.5, issue.estimated_hours |
|
34 | 34 | end |
|
35 | 35 | |
|
36 | def test_create_minimal | |
|
37 | issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 3, :status_id => 1, :priority => Enumeration.get_values('IPRI').first, :subject => 'test_create') | |
|
38 | assert issue.save | |
|
39 | assert issue.description.nil? | |
|
40 | end | |
|
41 | ||
|
36 | 42 | def test_create_with_required_custom_field |
|
37 | 43 | field = IssueCustomField.find_by_name('Database') |
|
38 | 44 | field.update_attribute(:is_required, true) |
General Comments 0
You need to be logged in to leave comments.
Login now