noosfero | Rename upload file (!1272)

Rodrigo Souto gitlab at mg.gitlab.com
Thu Jul 6 16:07:19 BRT 2017


Rodrigo Souto started a new discussion on test/functional/cms_controller_test.rb:

>      file.destroy
>    end
>  
> +  should 'be able to rename upload file' do
> +    post :new, :profile => profile identifier,
> +               :uploaded_file => { :filename => 'newname' }
> +               :type => UploadedFile.name,
> +               :article => {:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')}
> +    
> +    process_delayed_job_queue
> +    file = FilePresenter.for profile.articles.find_by(name: 'newnamepng')
> +    assert File.exists?(file.icon_name)
> +    assert File.name == 'newnamepng'
> +    file.destroy

You don't need to destroy the file in the end of the test. This is done automatically by the test infrastructure.

---
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1272#note_34374565
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170706/01aaa4ad/attachment-0001.html>


More information about the Noosfero-dev mailing list