2019-04-15 06:17:05 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-05-06 17:33:39 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Profiles::AvatarsController do
|
2019-01-16 07:09:29 -05:00
|
|
|
let(:user) { create(:user, avatar: fixture_file_upload("spec/fixtures/dk.png")) }
|
2015-05-06 17:33:39 -04:00
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
controller.instance_variable_set(:@user, user)
|
|
|
|
end
|
|
|
|
|
2016-07-25 14:16:19 -04:00
|
|
|
it 'removes avatar from DB by calling destroy' do
|
2015-05-06 17:33:39 -04:00
|
|
|
delete :destroy
|
|
|
|
@user = assigns(:user)
|
|
|
|
expect(@user.avatar.present?).to be_falsey
|
|
|
|
expect(@user).to be_valid
|
|
|
|
end
|
|
|
|
end
|