<commit_before>require 'rails_helper'

RSpec.describe Channels::ProfilesController, type: :controller do
  let (:channel) { create(:channel) }
  let (:project) { create(:project) }
  let! (:contribution) { create(:contribution, value: 10, project: project) }
  let! (:contribution2) { create(:contribution, value: 10, project: project) }

  describe "GET show" do
    before do
      project.update_attribute(:state, 'successful')
      channel.projects << project
      allow(request).to receive(:subdomain).and_return(channel.permalink)
      get :show, id: 'sample', locale: 'pt'
    end

    it 'should return status 200' do
      expect(response).to be_success
    end

    context 'Show statistics' do
      it 'Counts how many projects has inside a channel' do
        expect(assigns(:total_projects)).to eq(1)
      end

      it 'Count how many contributions a channel has' do
        expect(assigns(:total_contributions)).to eq(2)
      end

      it 'Sum pledged from all projects inside a channel' do
        expect(assigns(:total_pledged)).to eq(20)
      end

    end
  end

end
<commit_msg>Update Channels:ProfilesController specs<commit_after>require 'rails_helper'

RSpec.describe Channels::ProfilesController, type: :controller do
  describe "GET show" do
    let (:channel) { create(:channel) }

    it 'should return status 200' do
      allow(request).to receive(:subdomain).and_return(channel.permalink)
      get :show, id: 'sample', locale: 'pt'
      expect(response).to be_success
    end
  end
end

{'fraction_non_alphanumeric': 0.10950819672131147, 'fraction_numerical': 0.009836065573770493, 'mean_word_length': 3.5963855421686746, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1082157', 'n_tokens_mistral': 480, 'n_tokens_neox': 445, 'n_words': 135}