learn-co-students / rails-sidekiq-lab-v-000

Other
0 stars 802 forks source link

Songs_Controller_Spec file upload test written incorrectly #660

Open katrpilar opened 6 years ago

katrpilar commented 6 years ago

Need to change the file: upload syntax in the "uploads and processes a file on a background worker" test starting on line 10 from this:

it "uploads and processes a file on a background worker" do
      post :upload, file: fixture_file_upload('songs.csv', 'text/csv')
      expect(SongsWorker.jobs.size).to eq 1
    end

TO

  it "uploads and processes a file on a background worker" do
      params = {file: fixture_file_upload('songs.csv', 'text/csv')}
      post :upload, params: params
      expect(SongsWorker.jobs.size).to eq 1
    end
baschenbrenner commented 5 years ago

I struggled with a student to get this to work and we fixed it by just changing the second line of the test from: post :upload, file: fixture_file_upload('songs.csv', 'text/csv') to: post :upload, params: {file: fixture_file_upload('songs.csv', 'text/csv')}