title: Rspec: how to test Service Object method "call" which is called in Controller action create?
body: <p>Can somebody help me with rspec testing method call in Service Object?</p>
  <pre><code> class UserEntitiesController &lt; ApplicationController
      
        def create
      
          @result = UserEntities::Create.new(params).call
          return render '/422.json.jbuilder', status: :unprocessable_entity unless @result
        end
  </code></pre>
  <p>here is the service objects:</p>
  <pre><code> module UserEntities
    class Create
      attr_accessor :params
      def initialize(params)
        @params = params
      end
  
      def call
        @user_entity = UserEntity.new(user_entity_params)
        set_time
  
        if @user_entity.save
          @user_entity
        else
          error_result
        end
      end
  
      private
  
      def error_result
        false
      end
  
      def user_entity_params
        @params.require(:user_entity).permit(:information,
                                             :destroy_option,
                                             :reviews)
      end
  
      def set_time
        if @params[:available_days].present?
          @user_entity.termination = Time.now + @params[:available_days].days
        end
      end
    end
  end
  </code></pre>
  <p>I tried to find information how to do this, but there are not so many.
  Also i read some</p>