<commit_before>require 'spec_helper'

describe 'Login' do
  include CASino::Engine.routes.url_helpers

  subject { page }

  context 'with valid username and password' do
    before { sign_in }

    it { should_not have_button('Login') }
    its(:current_path) { should == sessions_path }
  end

  context 'with invalid username' do
    before { sign_in username: 'lalala', password: '<PASSWORD>' }

    it { should have_button('Login') }
    it { should have_text('Incorrect username or password') }
  end

  context 'with blank password' do
    before { sign_in password: '' }

    it { should have_button('Login') }
    it { should have_text('Incorrect username or password') }
  end
end
<commit_msg>Test language detection<commit_after>require 'spec_helper'

describe 'Login' do
  include CASino::Engine.routes.url_helpers

  subject { page }

  context 'with valid username and password' do
    before { sign_in }

    it { should_not have_button('Login') }
    its(:current_path) { should == sessions_path }
  end

  context 'with invalid username' do
    before { sign_in username: 'lalala', password: '<PASSWORD>' }

    it { should have_button('Login') }
    it { should have_text('Incorrect username or password') }
  end

  context 'with blank password' do
    before { sign_in password: '' }

    it { should have_button('Login') }
    it { should have_text('Incorrect username or password') }
  end

  context 'with german locale' do
    before do
      page.driver.header 'Accept-Language', 'de'
      visit login_path
    end

    it { should have_text('Benutzername') }
  end
end

{'fraction_non_alphanumeric': 0.10275689223057644, 'fraction_numerical': 0.0, 'mean_word_length': 3.5240793201133145, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4483396', 'n_tokens_mistral': 491, 'n_tokens_neox': 474, 'n_words': 149}