<commit_before>require 'test_helper'

class Devise::RegistrationsControllerTest < ActionController::TestCase
    include Devise::Test::ControllerHelpers
    
    def setup
        @request.env["devise.mapping"] = Devise.mappings[:user]
    end
    
    test "sign_up should create user" do
        assert_difference 'User.count', 1 do
            post :create, params: { "user" => { "email" => "<EMAIL>", "password" => "<PASSWORD>", "password_confirmation" => "<PASSWORD>" } }
        end
    end
    
    #quick check of a validation
    # test "sign_up without email should not create user" do
    #     assert_difference 'User.count', 0 do
    #         post :create, params: { "user" => { "email" => "", "password" => "<PASSWORD>", "password_confirmation" => "<PASSWORD>" } }
    #     end
    # end

end<commit_msg>add a check of user validation in registration tests<commit_after>require 'test_helper'

class Devise::RegistrationsControllerTest < ActionController::TestCase
    include Devise::Test::ControllerHelpers
    
    def setup
        @request.env["devise.mapping"] = Devise.mappings[:user]
    end
    
    test "sign_up should create user" do
        assert_difference 'User.count', 1 do
            post :create, params: { "user" => { "email" => "<EMAIL>", "password" => "<PASSWORD>", "password_confirmation" => "<PASSWORD>" } }
        end
    end
    
    #quick check of a user validation, just to be sure
    test "sign_up without email should not create user" do
        assert_no_difference 'User.count' do
            post :create, params: { "user" => { "email" => "", "password" => "<PASSWORD>", "password_confirmation" => "<PASSWORD>" } }
        end
    end

end
{'fraction_non_alphanumeric': 0.1342400946185689, 'fraction_numerical': 0.0017740981667652277, 'mean_word_length': 3.047846889952153, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 29, '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': '2272455', 'n_tokens_mistral': 493, 'n_tokens_neox': 487, 'n_words': 139}