2015-05-06 21:33:39 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Profiles::AvatarsController do
|
2016-02-24 17:42:31 +00:00
|
|
|
let(:user) { create(:user, :with_avatar) }
|
2015-05-06 21:33:39 +00:00
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
controller.instance_variable_set(:@user, user)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'destroy should remove avatar from DB' do
|
|
|
|
delete :destroy
|
|
|
|
@user = assigns(:user)
|
|
|
|
expect(@user.avatar.present?).to be_falsey
|
|
|
|
expect(@user).to be_valid
|
|
|
|
end
|
|
|
|
end
|