Last active
June 14, 2016 17:42
-
-
Save bastianwegge/6d2b35720e66c31e4a4e to your computer and use it in GitHub Desktop.
refile file upload using rspec and fixture file upload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "post #upload" do | |
it "image to object" do | |
container = create :container | |
file = fixture_file_upload(Rails.root.join('spec/fixtures/files/example.jpg'), 'image/jpeg') | |
container.attached_image = file | |
post :upload, container: container.to_param | |
expect(container.reload.attached_image).to be_present | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Little bit different approach: