<commit_before>require 'rails_helper'
require 'support/devise'
require 'support/factory_girl'

describe 'leagues/show' do
  context 'private league' do
    let(:comp) { create(:competition) }

    it 'displays league details' do
      assign(:competition, comp)

      render

      expect(rendered).to include(comp.name)
      description = ERB::Util.html_escape(comp.description)
      expect(rendered).to include(description)
      expect(rendered).to include('Private')
    end
  end

  context 'public league with teams and signups open' do
    let!(:comp) { create(:competition, private: false, signuppable: true) }
    let!(:div) { create(:division, competition: comp) }
    let!(:roster1) { create(:competition_roster, division: div, approved: false) }
    let!(:roster2) { create(:competition_roster, division: div, approved: true) }

    it 'displays league details' do
      assign(:competition, comp)

      render

      expect(rendered).to include(comp.name)
      expect(rendered).to_not include(div.name)
      expect(rendered).to include(roster1.name)
      expect(rendered).to include(roster2.name)
    end
  end

  context 'public league with teams and signups closed' do
    let!(:comp) { create(:competition, private: false, signuppable: false) }
    let!(:div) { create(:division, competition: comp) }
    let!(:roster1) { create(:competition_roster, division: div, approved: false) }
    let!(:roster2) { create(:competition_roster, division: div, approved: true) }

    it 'displays league details' do
      assign(:competition, comp)

      render

      expect(rendered).to include(comp.name)
      expect(rendered).to include(div.name)
      expect(rendered).to_not include(roster1.name)
      expect(rendered).to include(roster2.name)
    end
  end
end<commit_msg>Added disbanded team to leagues/show test<commit_after>require 'rails_helper'
require 'support/devise'
require 'support/factory_girl'

describe 'leagues/show' do
  context 'private league' do
    let(:comp) { create(:competition) }

    it 'displays league details' do
      assign(:competition, comp)

      render

      expect(rendered).to include(comp.name)
      description = ERB::Util.html_escape(comp.description)
      expect(rendered).to include(description)
      expect(rendered).to include('Private')
    end
  end

  context 'public league with teams and signups open' do
    let!(:comp) { create(:competition, private: false, signuppable: true) }
    let!(:div) { create(:division, competition: comp) }
    let!(:roster1) { create(:competition_roster, division: div, approved: false) }
    let!(:roster2) { create(:competition_roster, division: div, approved: true) }

    it 'displays league details' do
      assign(:competition, comp)

      render

      expect(rendered).to include(comp.name)
      expect(rendered).to_not include(div.name)
      expect(rendered).to include(roster1.name)
      expect(rendered).to include(roster2.name)
    end
  end

  context 'public league with teams and signups closed' do
    let!(:comp) { create(:competition, private: false, signuppable: false) }
    let!(:div) { create(:division, competition: comp) }
    let!(:roster1) { create(:competition_roster, division: div, approved: false) }
    let!(:roster2) { create(:competition_roster, division: div, approved: true) }
    let!(:roster3) { create(:competition_roster, division: div, disbanded: true) }

    it 'displays league details' do
      assign(:competition, comp)

      render

      expect(rendered).to include(comp.name)
      expect(rendered).to include(div.name)
      expect(rendered).to_not include(roster1.name)
      expect(rendered).to include(roster2.name)
      expect(rendered).to include(roster3.name)
    end
  end
end
{'fraction_non_alphanumeric': 0.12236174191824739, 'fraction_numerical': 0.004808976756612343, 'mean_word_length': 3.90694626474443, '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': '1677974', 'n_tokens_mistral': 1182, 'n_tokens_neox': 1121, 'n_words': 276}