<commit_before>require 'spec_helper'

describe Authentication do
  include Authentication

  describe '#restricted_for_current_user' do
    let(:exercise) { create(:exercise) }
    let(:result) { restricted_to_author(exercise) { true } }

    def current_user
      _user
    end

    context 'when is current user' do
      let(:_user) { exercise.author }
      it { expect(result).to be_true }
    end

    context 'when is current user' do
      let(:_user) { create(:user) }
      it { expect(result).to be_nil }
    end<commit_msg>Fix depracated be_true method by be_truthy<commit_after>require 'spec_helper'

describe Authentication do
  include Authentication

  describe '#restricted_for_current_user' do
    let(:exercise) { create(:exercise) }
    let(:result) { restricted_to_author(exercise) { true } }

    def current_user
      _user
    end

    context 'when is current user' do
      let(:_user) { exercise.author }
      it { expect(result).to be_truthy }
    end

    context 'when is current user' do
      let(:_user) { create(:user) }
      it { expect(result).to be_nil }
    end
{'fraction_non_alphanumeric': 0.09610154125113328, 'fraction_numerical': 0.0, 'mean_word_length': 3.1503759398496243, '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': '4662524', 'n_tokens_mistral': 355, 'n_tokens_neox': 334, 'n_words': 90}