Always use fixture_file_upload
helper to upload files in tests.
* Also is not a good idea to use File.open without closing the file handler. We should use it with a block or close it explicitly.
This commit is contained in:
parent
1a366e2588
commit
f8dde43d41
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ describe GroupsHelper do
|
|||
|
||||
it 'returns an url for the avatar' do
|
||||
group = create(:group)
|
||||
group.avatar = File.open(avatar_file_path)
|
||||
group.avatar = fixture_file_upload(avatar_file_path)
|
||||
group.save!
|
||||
expect(group_icon(group.path).to_s).
|
||||
to match("/uploads/group/avatar/#{group.id}/banana_sample.gif")
|
||||
|
|
Loading…
Reference in a new issue