<commit_before>require "rails_helper"

describe User do 
	let!(:user) { User.create!(username: "stephen", email:"<EMAIL>", password:"password") }

	context "username" do
		it "should return username" do 
			expect(user.username).to eq "stephen"
		end
	end
	context "email" do
		it "should return the email" do  
			expect(user.email).to eq("<EMAIL>")
		end
	end

	context "password" do 
		it "should return the password" do 
			expect(user.password).to eq("password")
		end
	end

	describe "Invalid username" do 
		it "is invalid without a username" do 
			expect { User.new(:user, username: nil) }.to raise_error(ArgumentError)
		end

		context "invalid email" do 
			it "is invalid without an email" do 
				expect { User.new(:user, email: nil) }.to raise_error(ArgumentError)
			end
		end

		context "invalid password" do 
			it "is invalid without a password" do 
				expect { User.new(:user, password: nil) }.to raise_error(ArgumentError)	
			end
		end
	end

	describe "validate presence of attributes" do 
		it { should validate_presence_of(:username) }

	 
		it { should validate_presence_of(:email) }
	end	
	
	describe "validate uniqueness of attributes" do 
		
		it { should validate_uniqueness_of(:username) }
		
		it { should validate_uniqueness_of(:email) }
	end

	describe "associations" do 
		it { should have_many(:games) }
	end
end




<commit_msg>Add have secure password to user mode spec -test success<commit_after>require "rails_helper"

describe User do 
	let!(:user) { User.create!(username: "stephen", email:"<EMAIL>", password:"password") }

	context "username" do
		it "should return username" do 
			expect(user.username).to eq "stephen"
		end
	end
	context "email" do
		it "should return the email" do  
			expect(user.email).to eq("<EMAIL>")
		end
	end

	context "password" do 
		it "should return the password" do 
			expect(user.password).to eq("password")
		end
	end

	describe "Invalid username" do 
		it "is invalid without a username" do 
			expect { User.new(:user, username: nil) }.to raise_error(ArgumentError)
		end

		context "invalid email" do 
			it "is invalid without an email" do 
				expect { User.new(:user, email: nil) }.to raise_error(ArgumentError)
			end
		end

		context "invalid password" do 
			it "is invalid without a password" do 
				expect { User.new(:user, password: nil) }.to raise_error(ArgumentError)	
			end
		end
	end

	describe "validate presence of attributes" do 
		it { should validate_presence_of(:username) }

	 
		it { should validate_presence_of(:email) }
	end	
	
	describe "validate uniqueness of attributes" do 
		
		it { should validate_uniqueness_of(:username) }
		
		it { should validate_uniqueness_of(:email) }
	end

	describe "associations" do 
		it { should have_many(:games) }
	end

	describe "has secure password" do 
		it { should have_secure_password }
	end
end





{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.0, 'mean_word_length': 3.6891447368421053, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1845072', 'n_tokens_mistral': 1046, 'n_tokens_neox': 896, 'n_words': 298}