# frozen_string_literal: truerequire'spec_helper'describeGitlab::Checks::PushCheckdoinclude_context'change access checks context'describe'#validate!'doit'does not raise any error'doexpect{subject.validate!}.not_toraise_errorendcontext'when the user is not allowed to push to the repo'doit'raises an error'doexpect(user_access).toreceive(:can_do_action?).with(:push_code).and_return(false)