module Avocado
  class AvocadoController < ActionController::Base

    def create
      File.open(json, 'wb+') { |f| f.write params[:file].read }
      head :ok
    end

    def index
      @data = File.read(json)
      render '/template'
    end

    private

      def json
        Avocado::Config.json_path.join('avocado.json')
      end

  end
end

module Avocado
  class AvocadoController < ActionController::Base

    def create
      File.open(json, 'w+') { |f| f.write params[:file].read }
      head :ok
    end

    def index
      @data = File.read(json)
      render '/template'
    end

    private

      def json
        Avocado::Config.json_path.join('avocado.json')
      end

  end
end

Remove binary from SpecsController File.open
Remove binary from SpecsController File.open