<commit_before>require "spec_helper"

describe PasswordsController do
  integrate_views
  
  before(:each) do
    generate_default_project_and_jnlps_with_mocks
    generate_portal_resources_with_mocks
    Admin::Project.stub!(:default_project).and_return(@mock_project)
  end
  
  describe "Reset password by login" do
    before(:each) do
      @user = Factory.create(:user, :login => "forgetful_jones", :password => "password", :password_confirmation => "password", :email => "<EMAIL>")
      
      @params = {
        :login => @user.login
      }
    end
    
    it "will fail gracefully if the user is not found by login" do
      @user.destroy<commit_msg>Fix "abstract_class?" bug in the rspec tests<commit_after>require "spec_helper"

describe PasswordsController do
  integrate_views
  
  before(:each) do
    generate_default_project_and_jnlps_with_mocks
    generate_portal_resources_with_mocks
    Admin::Project.stub!(:default_project).and_return(@mock_project)
  end
  
  describe "Reset password by login" do
    before(:each) do
      @user = Factory.create(:user, :login => "forgetful_jones", :password => "password", :password_confirmation => "password", :email => "<EMAIL>")
      
      @params = {
        :login => @user.login
      }
      
      # Stub User.find_by_login because of an rspec-related bug using the dynamic finder
      User.stub(:find_by_login) do |*login|
        User.first(:conditions => { :login => login })
      end
      
    end
    
    it "will fail gracefully if the user is not found by login" do
      @user.destroy
{'fraction_non_alphanumeric': 0.10325047801147227, 'fraction_numerical': 0.0, 'mean_word_length': 3.3370165745856353, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '3622334', 'n_tokens_mistral': 479, 'n_tokens_neox': 484, 'n_words': 119}