Project

General

Profile

Patch #33268 ยป custom_fields_controller_test.diff

Vincent Robert, 2020-04-07 13:32

View differences:

test/functional/custom_fields_controller_test.rb
303 303
    assert_equal 1, field.trackers.size
304 304
  end
305 305

  
306
  def test_create_project_custom_field
307
    field = new_record(ProjectCustomField) do
308
      post :create, :params => {
309
          :type => "ProjectCustomField",
310
          :custom_field => {
311
            :field_format => "string",
312
            :name => "test_new_project_custom_field",
313
            :description => "",
314
            :min_length => "",
315
            :max_length => "",
316
            :regexp => "",
317
            :text_formatting => "",
318
            :default_value => "",
319
            :url_pattern => "",
320
            :is_filter => "0",
321
            :is_required =>"0"
322
          }
323
        }
324
    end
325
    assert_redirected_to "/custom_fields/#{field.id}/edit"
326
    assert_equal "test_new_project_custom_field", field.name
327
  end
328

  
306 329
  def test_create_with_project_ids
307 330
    assert_difference 'CustomField.count' do
308 331
      post :create, :params => {
    (1-1/1)