<commit_before>require 'spec_helper'

describe UsersController do
  let!(:user) { User.make! }
  let!(:product) { Product.make!(user: user, is_approved: true) }
  let!(:wip) { Task.make!(user: user, product: product) }

  before { sign_in user }

  describe '#show' do
    it 'is successful' do
      get :show, id: user.username

      expect(response).to be_successful
    end

    it 'assigns wips' do
      get :show, id: user.username

      expect(assigns(:wips)).to be
    end
  end

  describe '#tracking' do
    it 'returns a ReadRaptor tracking URL' do<commit_msg>Add a super simple test to make sure filtering works<commit_after>require 'spec_helper'

describe UsersController do
  let!(:user) { User.make! }
  let!(:product) { Product.make!(user: user, is_approved: true) }
  let!(:wip) { Task.make!(user: user, product: product) }

  before { sign_in user }

  describe '#show' do
    it 'is successful' do
      get :show, id: user.username

      expect(response).to be_successful
    end

    it 'assigns wips' do
      get :show, id: user.username

      expect(assigns(:wips)).to be
    end

    it 'filters wips' do
      expected_filters = { user: 'assigned', state: true }.with_indifferent_access

      expect(FilterWipsQuery).to receive(:call).with(Wip.all, user, expected_filters).and_call_original

      get :show, id: user.username, user: 'assigned'
    end
  end

  describe '#tracking' do
    it 'returns a ReadRaptor tracking URL' do
{'fraction_non_alphanumeric': 0.11756664388243336, 'fraction_numerical': 0.0, 'mean_word_length': 3.331360946745562, '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': '6974798', 'n_tokens_mistral': 490, 'n_tokens_neox': 469, 'n_words': 141}