<commit_before>require 'rails_helper'

module Dre
  RSpec.describe DevicesController, type: :controller do
    routes { Dre::Engine.routes }

    let(:user) { User.create }

    before :each do
      allow(controller).to receive(:authenticate!) { true }
      allow(controller).to receive(:user) { user }
    end

    describe 'GET #index' do
      before :each do
        @device = create(:device, owner: user)
      end

      it 'returns http success' do
        get :index, format: :json
        expect(response).to have_http_status(:success)
      end

      it 'should assign a collection of devices for the current user' do
        get :index, format: :json
        expect(assigns(:devices)).to match_array([@device])
      end
    end

    describe 'PUT #register' do<commit_msg>Needed to ditch the routing in the devices controller spec because it's no longer required, as the routes are specified in the dummy app.<commit_after>require 'rails_helper'

module Dre
  RSpec.describe DevicesController, type: :controller do
    let(:user) { User.create }

    before :each do
      allow(controller).to receive(:authenticate!) { true }
      allow(controller).to receive(:user) { user }
    end

    describe 'GET #index' do
      before :each do
        @device = create(:device, owner: user)
      end

      it 'returns http success' do
        get :index, format: :json
        expect(response).to have_http_status(:success)
      end

      it 'should assign a collection of devices for the current user' do
        get :index, format: :json
        expect(assigns(:devices)).to match_array([@device])
      end
    end

    describe 'PUT #register' do
{'fraction_non_alphanumeric': 0.09621166566446182, 'fraction_numerical': 0.0, 'mean_word_length': 2.807780320366133, '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': '7550471', 'n_tokens_mistral': 473, 'n_tokens_neox': 452, 'n_words': 162}