Project

General

Profile

Patch #31113 » 0001-Update-Rails-to-5.2.3.patch

Marius BĂLTEANU, 2019-03-30 15:59

View differences:

Gemfile
2 2

  
3 3
gem "bundler", ">= 1.5.0"
4 4

  
5
gem "rails", "5.2.2.1"
5
gem "rails", "5.2.3"
6 6
gem "rouge", "~> 3.3.0"
7 7
gem "request_store", "1.0.5"
8 8
gem "mini_mime", "~> 1.0.1"
test/functional/issues_controller_test.rb
639 639
      }
640 640
    assert_response :success
641 641

  
642
    assert_equal 'text/csv; header=present', @response.content_type
642
    assert_equal 'text/csv', @response.content_type
643 643
    assert response.body.starts_with?("#,")
644 644
    lines = response.body.chomp.split("\n")
645 645
    # default columns + id and project
......
653 653
      }
654 654
    assert_response :success
655 655

  
656
    assert_equal 'text/csv; header=present', @response.content_type
656
    assert_equal 'text/csv', @response.content_type
657 657
  end
658 658

  
659 659
  def test_index_csv_without_any_filters
......
681 681
      assert_response :success
682 682
    end
683 683

  
684
    assert_equal 'text/csv; header=present', response.content_type
684
    assert_equal 'text/csv', response.content_type
685 685
    headers = response.body.chomp.split("\n").first.split(',')
686 686
    assert_include 'Description', headers
687 687
    assert_include 'test_index_csv_with_description', response.body
......
697 697
        :c => %w(subject spent_hours)
698 698
      }
699 699
    assert_response :success
700
    assert_equal 'text/csv; header=present', @response.content_type
700
    assert_equal 'text/csv', @response.content_type
701 701
    lines = @response.body.chomp.split("\n")
702 702
    assert_include "#{issue.id},#{issue.subject},7.33", lines
703 703
  end
......
709 709
      }
710 710
    assert_response :success
711 711

  
712
    assert_equal 'text/csv; header=present', @response.content_type
712
    assert_equal 'text/csv', @response.content_type
713 713
    assert_match /\A#,/, response.body
714 714
    lines = response.body.chomp.split("\n")
715 715
    assert_equal IssueQuery.new.available_inline_columns.size, lines[0].split(',').size
......
781 781
          :subject => str_utf8,
782 782
          :format => 'csv'
783 783
        }
784
      assert_equal 'text/csv; header=present', @response.content_type
784
      assert_equal 'text/csv', @response.content_type
785 785
      lines = @response.body.chomp.split("\n")
786 786
      header = lines[0]
787 787
      status = (+"\xaa\xac\xbaA").force_encoding('Big5')
......
803 803
          :format => 'csv',
804 804
          :set_filter => 1
805 805
        }
806
      assert_equal 'text/csv; header=present', @response.content_type
806
      assert_equal 'text/csv', @response.content_type
807 807
      lines = @response.body.chomp.split("\n")
808 808
      header = lines[0]
809 809
      issue_line = lines.find {|l| l =~ /^#{issue.id},/}
......
827 827
          :format => 'csv',
828 828
          :set_filter => 1
829 829
        }
830
      assert_equal 'text/csv; header=present', @response.content_type
830
      assert_equal 'text/csv', @response.content_type
831 831
      lines = @response.body.chomp.split("\n")
832 832
      assert_include "#{issue.id},1234.50,#{str1}", lines
833 833
    end
......
845 845
          :format => 'csv',
846 846
          :set_filter => 1
847 847
        }
848
      assert_equal 'text/csv; header=present', @response.content_type
848
      assert_equal 'text/csv', @response.content_type
849 849
      lines = @response.body.chomp.split("\n")
850 850
      assert_include "#{issue.id};1234,50;#{str1}", lines
851 851
    end
......
1313 1313
        :format => 'csv'
1314 1314
      }
1315 1315
    assert_response :success
1316
    assert_equal 'text/csv; header=present', response.content_type
1316
    assert_equal 'text/csv', response.content_type
1317 1317
    lines = response.body.chomp.split("\n")
1318 1318
    assert_include '1,"Related to #7, Related to #8, Blocks #11"', lines
1319 1319
    assert_include '2,Blocked by #12', lines
test/functional/timelog_controller_test.rb
1350 1350
    with_settings :date_format => '%m/%d/%Y' do
1351 1351
      get :index, :params => {:format => 'csv'}
1352 1352
      assert_response :success
1353
      assert_equal 'text/csv; header=present', response.content_type
1353
      assert_equal 'text/csv', response.content_type
1354 1354
    end
1355 1355
  end
1356 1356

  
......
1358 1358
    with_settings :date_format => '%m/%d/%Y' do
1359 1359
      get :index, :params => {:project_id => 1, :format => 'csv'}
1360 1360
      assert_response :success
1361
      assert_equal 'text/csv; header=present', response.content_type
1361
      assert_equal 'text/csv', response.content_type
1362 1362
    end
1363 1363
  end
1364 1364

  
test/functional/timelog_report_test.rb
233 233
      :format => "csv"
234 234
    }
235 235
    assert_response :success
236
    assert_equal 'text/csv; header=present', @response.content_type
236
    assert_equal 'text/csv', @response.content_type
237 237
    lines = @response.body.chomp.split("\n")
238 238
    # Headers
239 239
    assert_equal 'Project,User,Activity,2007-3,2007-4,Total time', lines.first
......
251 251
      :format => "csv"
252 252
    }
253 253
    assert_response :success
254
    assert_equal 'text/csv; header=present', @response.content_type
254
    assert_equal 'text/csv', @response.content_type
255 255
    lines = @response.body.chomp.split("\n")
256 256
    # Headers
257 257
    assert_equal 'Project,User,Activity,2007-3,2007-4,Total time', lines.first
......
289 289
      }
290 290
    end
291 291
    assert_response :success
292
    assert_equal 'text/csv; header=present', @response.content_type
292
    assert_equal 'text/csv', @response.content_type
293 293
    lines = @response.body.chomp.split("\n")
294 294
    # Headers
295 295
    s1 = (+"\xa5\xce\xa4\xe1,2011-11-11,\xa4u\xae\xc9\xc1`\xadp").force_encoding('Big5')
......
334 334
      }
335 335
    end
336 336
    assert_response :success
337
    assert_equal 'text/csv; header=present', @response.content_type
337
    assert_equal 'text/csv', @response.content_type
338 338
    lines = @response.body.chomp.split("\n")
339 339
    # Headers
340 340
    s1 = (+"\xa5\xce\xa4\xe1,2011-11-11,\xa4u\xae\xc9\xc1`\xadp").force_encoding('Big5')
......
369 369
        :format => "csv"
370 370
      }
371 371
      assert_response :success
372
      assert_equal 'text/csv; header=present', @response.content_type
372
      assert_equal 'text/csv', @response.content_type
373 373
      lines = @response.body.chomp.split("\n")
374 374
      # Headers
375 375
      s1 = (+"Utilisateur;2011-11-11;Temps total").force_encoding('ISO-8859-1')
test/functional/users_controller_test.rb
74 74
      assert_equal User.logged.status(1).count, response.body.chomp.split("\n").size - 1
75 75
      assert_include 'active', response.body
76 76
      assert_not_include 'locked', response.body
77
      assert_equal 'text/csv; header=present', @response.content_type
77
      assert_equal 'text/csv', @response.content_type
78 78
    end
79 79
  end
80 80

  
......
86 86
      assert_equal User.logged.status(3).count, response.body.chomp.split("\n").size - 1
87 87
      assert_include 'locked', response.body
88 88
      assert_not_include 'active', response.body
89
      assert_equal 'text/csv; header=present', @response.content_type
89
      assert_equal 'text/csv', @response.content_type
90 90
    end
91 91
  end
92 92

  
......
96 96

  
97 97
    assert_equal User.logged.like('John').count, response.body.chomp.split("\n").size - 1
98 98
    assert_include 'John', response.body
99
    assert_equal 'text/csv; header=present', @response.content_type
99
    assert_equal 'text/csv', @response.content_type
100 100
  end
101 101

  
102 102
  def test_index_csv_with_group_filter
......
104 104
    assert_response :success
105 105

  
106 106
    assert_equal Group.find(10).users.count, response.body.chomp.split("\n").size - 1
107
    assert_equal 'text/csv; header=present', @response.content_type
107
    assert_equal 'text/csv', @response.content_type
108 108
  end
109 109

  
110 110
  def test_show
    (1-1/1)