summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2016-12-18 20:35:07 -0500
committerRuben Davila <rdavila84@gmail.com>2016-12-22 00:05:57 -0500
commit708e788b611544cb901ca3ec7f226b71b6100c66 (patch)
tree71abc83fc7f5815a79a2878465023750090dbd9b
parentdbb11ad409e7deeb39e3c63f85bb217917a8cd1b (diff)
downloadgitlab-ce-708e788b611544cb901ca3ec7f226b71b6100c66.tar.gz
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.
-rw-r--r--spec/helpers/groups_helper_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/helpers/groups_helper_spec.rb b/spec/helpers/groups_helper_spec.rb
index 233d00534e5..c8b0d86425f 100644
--- a/spec/helpers/groups_helper_spec.rb
+++ b/spec/helpers/groups_helper_spec.rb
@@ -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")