<commit_before># frozen_string_literal: true

require 'rails_helper'

describe 'about/_links.html.haml' do
  it 'does not show sign in link when signed in' do
    allow(view).to receive(:user_signed_in?).and_return(true)
    render

    expect(rendered).to have_content(I18n.t('about.get_started'))
    expect(rendered).not_to have_content(I18n.t('auth.login'))
  end

  it 'shows sign in link when signed out' do
    allow(view).to receive(:user_signed_in?).and_return(false)
    render

    expect(rendered).to have_content(I18n.t('about.get_started'))
    expect(rendered).to have_content(I18n.t('auth.login'))
  end
end<commit_msg>Fix spec for hide get started (#2585)<commit_after># frozen_string_literal: true

require 'rails_helper'

describe 'about/_links.html.haml' do
  it 'does not show sign in link when signed in' do
    instance_presenter = double(:instance_presenter, open_registrations: true)
    assign(:instance_presenter, instance_presenter)
    allow(view).to receive(:user_signed_in?).and_return(true)
    render

    expect(rendered).to have_content(I18n.t('about.get_started'))
    expect(rendered).not_to have_content(I18n.t('auth.login'))
  end

  it 'shows sign in link when signed out' do
    instance_presenter = double(:instance_presenter, open_registrations: true)
    assign(:instance_presenter, instance_presenter)
    allow(view).to receive(:user_signed_in?).and_return(false)
    render

    expect(rendered).to have_content(I18n.t('about.get_started'))
    expect(rendered).to have_content(I18n.t('auth.login'))
  end

  it 'shows sign in link when register closed' do
    instance_presenter = double(:instance_presenter, open_registrations: false)
    assign(:instance_presenter, instance_presenter)
    allow(view).to receive(:user_signed_in?).and_return(false)
    render

    expect(rendered).not_to have_content(I18n.t('about.get_started'))
    expect(rendered).to have_content(I18n.t('auth.login'))
  end
end
{'fraction_non_alphanumeric': 0.11646998460749101, 'fraction_numerical': 0.012314007183170857, 'mean_word_length': 5.190476190476191, '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': '2877419', 'n_tokens_mistral': 676, 'n_tokens_neox': 629, 'n_words': 130}