debian-mirror-gitlab/spec/controllers/profiles/avatars_controller_spec.rb

18 lines
433 B
Ruby
Raw Normal View History

2015-09-11 14:41:01 +05:30
require 'spec_helper'
describe Profiles::AvatarsController do
let(:user) { create(:user, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png")) }
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