Project

General

Profile

Defect #23377 » do_not_show_status_field_on_new_version_form.patch

Marius BĂLTEANU, 2016-07-25 01:51

View differences:

app/views/versions/_form.html.erb
4 4
<div class="box tabular">
5 5
<p><%= f.text_field :name, :size => 60, :required => true %></p>
6 6
<p><%= f.text_field :description, :size => 60 %></p>
7
<p><%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %></p>
7
<% unless @version.new_record? %>
8
  <p><%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %></p>
9
<% end %>
8 10
<p><%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %></p>
9 11
<p><%= f.date_field :effective_date, :size => 10 %><%= calendar_for('version_effective_date') %></p>
10 12
<p><%= f.select :sharing, @version.allowed_sharings.collect {|v| [format_version_sharing(v), v]} %></p>
test/functional/versions_controller_test.rb
128 128
    get :new, :params => {:project_id => '1'}
129 129
    assert_response :success
130 130
    assert_select 'input[name=?]', 'version[name]'
131
    assert_select 'select[name=?]', 'version[status]', false
131 132
  end
132 133

  
133 134
  def test_new_from_issue_form
......
175 176
    @request.session[:user_id] = 2
176 177
    get :edit, :params => {:id => 2}
177 178
    assert_response :success
178
    assert_select 'input[name=?][value=?]', 'version[name]', Version.find(2).name
179
    version = Version.find(2)
180

  
181
    assert_select 'select[name=?]', 'version[status]' do
182
      assert_select 'option[value=?][selected="selected"]', version.status
183
    end
184
    assert_select 'input[name=?][value=?]', 'version[name]', version.name
179 185
  end
180 186

  
181 187
  def test_close_completed
......
190 196
  def test_post_update
191 197
    @request.session[:user_id] = 2
192 198
    put :update, :params => {
193
      :id => 2, 
199
      :id => 2,
194 200
      :version => {
195 201
        :name => 'New version name',
196 202
        :effective_date => Date.today.strftime("%Y-%m-%d")
    (1-1/1)