Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8069499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:04:15+00:00 2026-06-05T13:04:15+00:00

I do some integration testing like this : def user.excel_import fixture_excel = fixture_file_upload(‘goodsins.xls’, ‘text/xls’)

  • 0

I do some integration testing like this :

 def user.excel_import
          fixture_excel = fixture_file_upload('goodsins.xls', 'text/xls')
          post excel_import_goods_ins_goods_ins_path, :dump=> {:excel_file=>fixture_excel}, :html => { :multipart => "true" }
          assert_response :redirect
          assert_redirected_to goods_ins_path
       end

But when I run the testing it is said that : goodsins.xls file does not exist.
FYI : I put the file in the folder that named fixtures.

Any idea? Thx u very much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:04:17+00:00Added an answer on June 5, 2026 at 1:04 pm

    The notes here: http://apidock.com/rails/ActionController/TestProcess/fixture_file_upload indicate that you need to include a slash before the path or file name.

    try fixture_file_upload('/goodsins.xls', 'text/xls') and see if that helps.

    fixture_file_upload Source:

    # File actionpack/lib/action_controller/test_process.rb, line 523
    def fixture_file_upload(path, mime_type = nil, binary = false)
      if ActionController::TestCase.respond_to?(:fixture_path)
        fixture_path = ActionController::TestCase.send(:fixture_path)
      end
    
      ActionController::TestUploadedFile.new("#{fixture_path}#{path}",
        mime_type, binary)
    end
    

    Update from Question Owner:

    Solution:

    add include ActionDispatch::TestProcess to test_helper.rb

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’ve created a basic framework for webapps (some static pages, user authentication, unit/integration testing
I would like to do some integration testing of a web service from within
I'm setting up some test scaffolding around an existing project. This includes some integration
So, I'm confused by this failure. I'm using MSTest to run some integration tests
I'm doing some Unit/Integration testing in a Non-Java language (Python), using a test-framework (
(Leaving aside hair-splitting about if this is integration-testing or unit-testing.) I would rather first
Note: This is not for unit testing or integration testing. This is for when
I want to write some integration-tests for my connect-middleware and test it with real-http-requests
I am trying to write some integration tests for some SQL server stored procedures
I am running Jetty during some integration tests in daemon mode and am getting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.