<commit_before>require 'rails_helper'

describe UserTipsController do
  let(:user) { create(:user) }
  let(:tip) { Tip.create }
  before(:each) { sign_in user }

  describe "POST #create" do
    let(:user_tip_params) { {user_id: user, tip_id: tip, result: 'Liked', feedback: 'This tip was good'} }

      it 'saves the new UserTip in the database' do
        expect { post :create, user_tip: user_tip_params }.to change{
          UserTip.count
        }.by(1)
        uploaded_user_tip = UserTip.last
        expect(uploaded_user_tip.feedback).to_not be_nil
        expect(uploaded_user_tip.user).to eq user
      end
  end
end<commit_msg>moved user_tip_params to let statement<commit_after>require 'rails_helper'

describe UserTipsController do
  let(:user) { create(:user) }
  let(:tip) { Tip.create }
  let(:user_tip_params) { {user_id: user, tip_id: tip, result: 'Liked', feedback: 'This tip was good'} }
  before(:each) { sign_in user }

  describe "POST #create" do
      it 'saves the new UserTip in the database' do
        expect { post :create, user_tip: user_tip_params }.to change{
          UserTip.count
        }.by(1)
        uploaded_user_tip = UserTip.last
        expect(uploaded_user_tip.feedback).to_not be_nil
        expect(uploaded_user_tip.user).to eq user
      end
  end
end
{'fraction_non_alphanumeric': 0.10599078341013825, 'fraction_numerical': 0.0015360983102918587, 'mean_word_length': 3.2305194805194803, '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': '6637786', 'n_tokens_mistral': 445, 'n_tokens_neox': 431, 'n_words': 115}