Skip to content

Instantly share code, notes, and snippets.

@all4miller
Created January 9, 2013 08:29
Show Gist options
  • Save all4miller/4491574 to your computer and use it in GitHub Desktop.
Save all4miller/4491574 to your computer and use it in GitHub Desktop.
file attachements
require 'spec_helper'
describe SomeController do
def file_attachment
test_document = "#{Rails.root}/spec/support/file.csv"
Rack::Test::UploadedFile.new(test_document, "text/csv")
end
describe "POST to #import" do
before do
post :import, file: file_attachment
end
it {should redirect_to some_path }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment