Project

General

Profile

Defect #43002 » remove-test_entry_should_return_text_plain_for_js_files.patch

Go MAEDA, 2025-07-12 11:17

View differences:

test/functional/repositories_subversion_controller_test.rb (作業コピー)
357 357
      assert_equal "attachment; filename=\"helloworld.c\"; filename*=UTF-8''helloworld.c", @response.headers['Content-Disposition']
358 358
    end
359 359

  
360
    def test_entry_should_return_text_plain_for_js_files
361
      # JavaScript files should be served as 'text/plain' instead of
362
      # 'application/javascript' to avoid
363
      # ActionController::InvalidCrossOriginRequest exception
364
      assert_equal 0, @repository.changesets.count
365
      @repository.fetch_changesets
366
      @project.reload
367
      assert_equal NUM_REV, @repository.changesets.count
368
      get(
369
        :raw,
370
        :params => {
371
          :id => PRJ_ID,
372
          :repository_id => @repository.id,
373
          :path => repository_path_hash(['subversion_test', 'foo.js'])[:param]
374
        }
375
      )
376
      assert_response :success
377
      assert_equal 'text/plain', @response.media_type
378
      assert_match /attachment/, @response.headers['Content-Disposition']
379
    end
380

  
381 360
    def test_directory_entry
382 361
      assert_equal 0, @repository.changesets.count
383 362
      @repository.fetch_changesets
    (1-1/1)