<commit_before>require 'spec_helper'

describe DatasetsController, type: :controller do

  before(:each) do
    @user = create(:user, name: "User McUser", email: "<EMAIL>")
  end

  describe 'destroy' do
    it 'deletes a dataset' do
      sign_in @user

      @dataset = create(:dataset, user: @user)

      expect(Dataset).to receive(:find).with(@dataset.id.to_s) {
        @dataset
      }

      expect(@dataset).to receive(:fetch_repo)
      expect(@dataset).to receive(:destroy)

      request = delete 'destroy', id: @dataset.id
      expect(request).to redirect_to(dashboard_path)
      expect(flash[:notice]).to eq("Dataset '#{@dataset.name}' deleted sucessfully")
    end
  end

end<commit_msg>Rails 5 - Using positional arguments in functional tests has been deprecated<commit_after>require 'spec_helper'

describe DatasetsController, type: :controller do

  before(:each) do
    @user = create(:user, name: "User McUser", email: "<EMAIL>")
  end

  describe 'destroy' do
    it 'deletes a dataset' do
      sign_in @user

      @dataset = create(:dataset, user: @user)

      expect(Dataset).to receive(:find).with(@dataset.id.to_s) {
        @dataset
      }

      expect(@dataset).to receive(:fetch_repo)
      expect(@dataset).to receive(:destroy)

      request = delete :destroy, params: { id: @dataset.id }
      expect(request).to redirect_to(dashboard_path)
      expect(flash[:notice]).to eq("Dataset '#{@dataset.name}' deleted sucessfully")
    end
  end

end
{'fraction_non_alphanumeric': 0.1329284750337382, 'fraction_numerical': 0.0006747638326585695, 'mean_word_length': 3.493939393939394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5888323', 'n_tokens_mistral': 458, 'n_tokens_neox': 448, 'n_words': 116}