You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: search_by_day_test.rb
    path of file: ./repos/workarea/core/test/models/workarea/metrics
    
    the code of the file until where you have to start completion: require 'test_helper'

module Workarea

    
      def test_save_search_typecasting
        SearchByDay.save_search(:foo, '0')
        assert_equal(1, SearchByDay.count)

        search = SearchByDay.first.as_document
        assert_equal('foo', search['query_id'])
        assert_equal('foo', search['query_string'])
        assert_equal(0, search['total_results'])
        assert_equal(1, search['searches'])
      end