2019-07-31 22:56:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Profiles::AvatarsController do
|
2019-03-02 22:35:43 +05:30
|
|
|
let(:user) { create(:user, avatar: fixture_file_upload("spec/fixtures/dk.png")) }
|
2015-09-11 14:41:01 +05:30
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
controller.instance_variable_set(:@user, user)
|
|
|
|
end
|
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
it 'removes avatar from DB by calling destroy' do
|
2015-09-11 14:41:01 +05:30
|
|
|
delete :destroy
|
|
|
|
@user = assigns(:user)
|
|
|
|
expect(@user.avatar.present?).to be_falsey
|
|
|
|
expect(@user).to be_valid
|
|
|
|
end
|
|
|
|
end
|