<commit_before>require "rails_helper"

RSpec.describe "welcome/index" do

  it 'Display images on orbit carrousel when we have defined image_default' do
    debate = create(:debate)

    render template: "welcome/_recommended_carousel.html.erb",
           locals: { key: "debates",
                     recommendeds: [debate],
                     image_field: nil,
                     image_version: nil,
                     image_default: "https://dummyimage.com/600x400/000/fff",
                     klass: ""}

    within 'li[data-slide="0"] .card' do
      expect(page).to have_selector("img")
    end

  end

  it 'Not display images on orbit carrousel when we have not defined image_default' do
    debate = create(:debate)

    render template: "welcome/_recommended_carousel.html.erb",
           locals: { key: "debates",
                     recommendeds: [debate],
                     image_field: nil,
                     image_version: nil,
                     image_default: nil,
                     klass: ""}

    within 'li[data-slide="0"] .card' do
      expect(page).not_to have_selector("img")
    end

  end

end
<commit_msg>Changed class into index spec.<commit_after>require "rails_helper"

RSpec.describe "welcome/index" do

  it 'Display images on orbit carrousel when we have defined image_default' do
    debate = create(:debate)

    render template: "welcome/_recommended_carousel.html.erb",
           locals: { key: "debates",
                     recommendeds: [debate],
                     image_field: nil,
                     image_version: nil,
                     image_default: "https://dummyimage.com/600x400/000/fff",
                     carousel_size: "medium-6 large-6 medium-centered large-centered"}

    within 'li[data-slide="0"] .card' do
      expect(page).to have_selector("img")
    end

  end

  it 'Not display images on orbit carrousel when we have not defined image_default' do
    debate = create(:debate)

    render template: "welcome/_recommended_carousel.html.erb",
           locals: { key: "debates",
                     recommendeds: [debate],
                     image_field: nil,
                     image_version: nil,
                     image_default: nil,
                     carousel_size: "medium-6 large-6 medium-centered large-centered"}

    within 'li[data-slide="0"] .card' do
      expect(page).not_to have_selector("img")
    end

  end

end

{'fraction_non_alphanumeric': 0.09889208042675421, 'fraction_numerical': 0.010668855149774312, 'mean_word_length': 1.9587378640776698, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '357022', 'n_tokens_mistral': 741, 'n_tokens_neox': 682, 'n_words': 176}