<commit_before>require 'spec_helper'

describe Api::FbosConfigsController do

  include Devise::Test::ControllerHelpers

  let(:user) { FactoryBot.create(:user) }
  let(:device) { user.device }

  describe '#show' do
    it 'handles requests' do
      sign_in user
      device.fbos_config.destroy! # Let's test defaults.
      get :show, format: :json
      expect(response.status).to be(200)
      {
        device_id:               device.id,
        auto_sync:               false,
        beta_opt_in:             false,
        disable_factory_reset:   false,
        firmware_input_log:      false,
        firmware_output_log:     false,
        sequence_body_log:       false,
        sequence_complete_log:   false,
        sequence_init_log:       false,
        arduino_debug_messages:  false,
        network_not_found_timer: nil,
        os_auto_update:          false,
        firmware_hardware:       "arduino",
        api_migrated:            false
      }.to_a.map { |key, value| expect(json[key]).to eq(value) }

      { created_at: String, updated_at: String }
        .to_a.map { |key, value| expect(json[key]).to be_kind_of(value) }
    end<commit_msg>Update specs<commit_after>require 'spec_helper'

describe Api::FbosConfigsController do

  include Devise::Test::ControllerHelpers

  let(:user) { FactoryBot.create(:user) }
  let(:device) { user.device }

  describe '#show' do
    it 'handles requests' do
      sign_in user
      device.fbos_config.destroy! # Let's test defaults.
      get :show, format: :json
      expect(response.status).to be(200)
      {
        device_id:               device.id,
        auto_sync:               false,
        beta_opt_in:             false,
        disable_factory_reset:   false,
        firmware_input_log:      false,
        firmware_output_log:     false,
        sequence_body_log:       false,
        sequence_complete_log:   false,
        sequence_init_log:       false,
        arduino_debug_messages:  false,
        network_not_found_timer: nil,
        os_auto_update:          true,
        firmware_hardware:       "arduino",
        api_migrated:            false
      }.to_a.map { |key, value| expect(json[key]).to eq(value) }

      { created_at: String, updated_at: String }
        .to_a.map { |key, value| expect(json[key]).to be_kind_of(value) }
    end
{'fraction_non_alphanumeric': 0.09540034071550256, 'fraction_numerical': 0.002555366269165247, 'mean_word_length': 2.140374331550802, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4497995', 'n_tokens_mistral': 739, 'n_tokens_neox': 723, 'n_words': 146}