mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Let activerecord handle the picture upload in factories
This commit is contained in:
parent
c876a2d1cf
commit
5b20c992ae
2 changed files with 8 additions and 9 deletions
|
|
@ -46,10 +46,10 @@ FactoryGirl.define do
|
|||
create(:question, conferences: [conference])
|
||||
|
||||
# Logo...
|
||||
uploader = PictureUploader.new(conference, :picture)
|
||||
File.open('app/assets/images/rails.png') { |f| uploader.store!(f) }
|
||||
conference.logo_file_name = 'rails.png'
|
||||
conference.save
|
||||
File.open("spec/support/logos/#{1 + rand(13)}.png") do |file|
|
||||
conference.picture = file
|
||||
end
|
||||
conference.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue