Commit f8dde43d authored by Ruben Davila's avatar Ruben Davila

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.
parent 1a366e25
...@@ -6,7 +6,7 @@ describe GroupsHelper do ...@@ -6,7 +6,7 @@ describe GroupsHelper do
it 'returns an url for the avatar' do it 'returns an url for the avatar' do
group = create(:group) group = create(:group)
group.avatar = File.open(avatar_file_path) group.avatar = fixture_file_upload(avatar_file_path)
group.save! group.save!
expect(group_icon(group.path).to_s). expect(group_icon(group.path).to_s).
to match("/uploads/group/avatar/#{group.id}/banana_sample.gif") to match("/uploads/group/avatar/#{group.id}/banana_sample.gif")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment