<commit_before>require 'spec_helper'

describe "DeviseUsers" do

  before do
    @user1  = User.create(name: 'test1', email: '<EMAIL>',  password: '<PASSWORD>')
    @user2  = User.create(name: 'test2', email: '<EMAIL>',  password: '<PASSWORD>')
  end

  describe "devise creates a new user" do
    it "has welcome message after devise/registrations#new with valid credentials" do
      visit new_user_registration_path

      fill_in "Email",                 :with => "<EMAIL>"
      fill_in "Password",              :with => "<PASSWORD>"
      fill_in "Password confirmation", :with => "<PASSWORD>"

      click_button "Sign up"

      expect(page).to have_content("Welcome! You have signed up successfully.")
    end

    it "has error message after devise/registrations#new with invalid credentials" do
      visit new_user_registration_path

      fill_in "Email",                 :with => "<EMAIL>"
      fill_in "Password",              :with => "<PASSWORD>"
      fill_in "Password confirmation", :with => "<PASSWORD>"

      click_button "Sign up"

      expect(page).to have_content("errors prohibited this user from being saved")
    end
  end

  describe "devise authenticates valid user" do
    it "has sign in message after devise/sessions#new with valid credentials" do

      visit new_user_session_path

      fill_in "Email",    :with => "<EMAIL>"
      fill_in "Password", :with => "<PASSWORD>"

      click_button "Sign in"

      expect(page).to have_content("Signed in successfully.")
    end

    it "does not have succesful login message after devise/sessions#new with invalid email" do

      visit new_user_session_path

      fill_in "Email",    :with => "<EMAIL>"
      fill_in "Password", :with => "<PASSWORD>"

      click_button "Sign in"
<commit_msg>Change confirmable Devise feature spec expectations<commit_after>require 'spec_helper'

describe "DeviseUsers" do

  before do
    @user1  = create(:user, name: 'test1', email: '<EMAIL>',  password: '<PASSWORD>')
    @user2  = create(:user, name: 'test2', email: '<EMAIL>',  password: '<PASSWORD>')

    @user2.confirm!
  end

  describe "devise creates a new user" do
    it "has welcome message after devise/registrations#new with valid credentials" do
      visit new_user_registration_path

      fill_in "Email",                 :with => "<EMAIL>"
      fill_in "Password",              :with => "<PASSWORD>"
      fill_in "Password confirmation", :with => "<PASSWORD>"

      click_button "Sign up"

      expect(page).to have_content("A message with a confirmation \
              link has been sent to your email address. Please open \
              the link to activate your account.")
    end

    it "has error message after devise/registrations#new with invalid credentials" do
      visit new_user_registration_path

      fill_in "Email",                 :with => "<EMAIL>"
      fill_in "Password",              :with => "<PASSWORD>"
      fill_in "Password confirmation", :with => "<PASSWORD>"

      click_button "Sign up"

      expect(page).to have_content("errors prohibited this user from being saved")
    end
  end

  describe "devise authenticates valid user" do
    it "has sign in message after devise/sessions#new with valid credentials" do

      visit new_user_session_path

      fill_in "Email",    :with => "#{@user2.email}"
      fill_in "Password", :with => "#{<PASSWORD>}"

      click_button "Sign in"

      expect(page).to have_content("Signed in successfully.")
    end

    it "does not have succesful login message after devise/sessions#new with invalid email" do

      visit new_user_session_path

      fill_in "Email",    :with => "<EMAIL>"
      fill_in "Password", :with => "<PASSWORD>"

      click_button "Sign in"

{'fraction_non_alphanumeric': 0.10974632843791722, 'fraction_numerical': 0.0026702269692923898, 'mean_word_length': 2.9266247379454926, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 50, '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': '814110', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1049, 'n_words': 351}