<commit_before>describe "dashboard/login.html.haml" do
  helper(JsHelper)

  context "login_div contains browser and TZ hidden fields" do
    before do
      EvmSpecHelper.create_guid_miq_server_zone
      stub_settings(:server => {}, :session => {}, :authentication => {})
    end

    it "when authentication is 'database'" do
      allow(view).to receive(:current_tenant).and_return(Tenant.seed)
      allow(User).to receive(:mode).and_return("database")
      render
      expect(response).to have_selector("div#login_div:has(input#browser_name)")
      expect(response).to have_selector("div#login_div:has(input#browser_version)")
      expect(response).to have_selector("div#login_div:has(input#browser_os)")
      expect(response).to have_selector("div#login_div:has(input#user_TZO)")
    end

    it "when authentication is not 'database'" do
      allow(view).to receive(:current_tenant).and_return(Tenant.seed)
      allow(User).to receive(:mode).and_return("ldap")
      render
      expect(response).to have_selector("div#login_div:has(input#browser_name)")
      expect(response).to have_selector("div#login_div:has(input#browser_version)")
      expect(response).to have_selector("div#login_div:has(input#browser_os)")
      expect(response).to have_selector("div#login_div:has(input#user_TZO)")
    end
  end

  context "on screen region/zone/appliance info" do
    let(:labels) { %w(Region: Zone: Appliance:) }
    before do
      EvmSpecHelper.create_guid_miq_server_zone
      MiqRegion.seed
    end

    it "show" do
      allow(view).to receive(:current_tenant).and_return(Tenant.seed)
      stub_settings(:server => {}, :session => {:show_login_info => true}, :authentication => {})
      render
      labels.each do |label|
        expect(response).to have_selector('p', :text => label)
      end
    end

    it "hide" do
      allow(view).to receive(:current_tenant).and_return(Tenant.seed)
      stub_settings(:server => {}, :session => {:show_login_info => false}, :authentication => {})<commit_msg>Remove invalid partials that aren't used.<commit_after>describe "dashboard/login.html.haml" do
  helper(JsHelper)

  context "login_div contains browser and TZ hidden fields" do
    before do
      EvmSpecHelper.create_guid_miq_server_zone
      stub_settings(:server => {}, :session => {}, :authentication => {})
    end

    it "when authentication is 'database'" do
      render
      expect(response).to have_selector("div#login_div:has(input#browser_name)")
      expect(response).to have_selector("div#login_div:has(input#browser_version)")
      expect(response).to have_selector("div#login_div:has(input#browser_os)")
      expect(response).to have_selector("div#login_div:has(input#user_TZO)")
    end

    it "when authentication is not 'database'" do
      render
      expect(response).to have_selector("div#login_div:has(input#browser_name)")
      expect(response).to have_selector("div#login_div:has(input#browser_version)")
      expect(response).to have_selector("div#login_div:has(input#browser_os)")
      expect(response).to have_selector("div#login_div:has(input#user_TZO)")
    end
  end

  context "on screen region/zone/appliance info" do
    let(:labels) { %w(Region: Zone: Appliance:) }
    before do
      EvmSpecHelper.create_guid_miq_server_zone
      MiqRegion.seed
    end

    it "show" do
      stub_settings(:server => {}, :session => {:show_login_info => true}, :authentication => {})
      render
      labels.each do |label|
        expect(response).to have_selector('p', :text => label)
      end
    end

    it "hide" do
      stub_settings(:server => {}, :session => {:show_login_info => false}, :authentication => {})
{'fraction_non_alphanumeric': 0.13409337676438654, 'fraction_numerical': 0.0, 'mean_word_length': 4.226950354609929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '815161', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1146, 'n_words': 207}