<commit_before>package br.leosilvadev.gchat.user.registration

import static org.junit.Assert.*
import geb.spock.GebSpec

import org.springframework.boot.test.IntegrationTest
import org.springframework.boot.test.SpringApplicationConfiguration
import org.springframework.test.context.web.WebAppConfiguration

import br.leosilvadev.gchat.ApplicationTest
import br.leosilvadev.gchat.utils.RandomString

@SpringApplicationConfiguration(classes = ApplicationTest.class)
@WebAppConfiguration
@IntegrationTest("server.port:8080")
class UserRegistrationIT extends GebSpec {
	
	def "Should not accept different passwords"(){
		given: "A user in registration page"
			go "/#register"
			waitFor { $('#modal-registration').displayed }
	
		when: "User try to register himself"
			$('input#name').value("NewUser")
			$('input#email').value("<EMAIL>")
			$('input#password').value("<PASSWORD>")
			$('input#passwordConfirmation').value("<PASSWORD>")
			$('button#btn-register').click()
			
		then: "A message about different passwords must be visible"
			$('#registration-messages div.alert > span.message').text() == "Passwords does not match"
		
	}
	
	def "Should register a new user"(){
		def email = RandomString.randomEmail()
		
		given: "A user in registration page"
			go "/#register"
			waitFor { $('#modal-registration').displayed }
	
		when: "User try to register himself"
			$('input#name').value("NewUser")
			$('input#email').value(email)
			$('input#password').value("<PASSWORD>")
			$('input#passwordConfirmation').value("<PASSWORD>")
			$('button#btn-register').click()
			
		then: "A user must be saved"
			$('#global-notifications > div.alert > span.message').text() == "User registered successfully!"
		
	}

}<commit_msg>simulation of broken geb test<commit_after>package br.leosilvadev.gchat.user.registration

import static org.junit.Assert.*
import geb.spock.GebSpec

import org.springframework.boot.test.IntegrationTest
import org.springframework.boot.test.SpringApplicationConfiguration
import org.springframework.test.context.web.WebAppConfiguration

import br.leosilvadev.gchat.ApplicationTest
import br.leosilvadev.gchat.utils.RandomString

@SpringApplicationConfiguration(classes = ApplicationTest.class)
@WebAppConfiguration
@IntegrationTest("server.port:8080")
class UserRegistrationIT extends GebSpec {
	
	def "Should not accept different passwords"(){
		given: "A user in registration page"
			go "/#register"
			waitFor { $('#modal-registration').displayed }
	
		when: "User try to register himself"
			$('input#name').value("NewUser")
			$('input#email').value("<EMAIL>")
			$('input#password').value("<PASSWORD>")
			$('input#passwordConfirmation').value("<PASSWORD>")
			$('button#btn-register').click()
			
		then: "A message about different passwords must be visible"
			$('#registration-messages div.alert > span.message').text() == "Passwords does not match"
		
	}
	
	def "Should register a new user"(){
		def email = RandomString.randomEmail()
		
		given: "A user in registration page"
			go "/#register"
			waitFor { $('#modal-registration').displayed }
	
		when: "User try to register himself"
			$('input#name').value("NewUser")
			$('input#email').value(email)
			$('input#password').value("<PASSWORD>")
			$('input#passwordConfirmation').value("<PASSWORD>")
			$('button#btn-register').click()
			
		then: "A user must be saved"
			$('#global-notifications > div.alert > span.message').text() == "User registered successfully!"
			2==1
	}

}
{'fraction_non_alphanumeric': 0.15145407428735963, 'fraction_numerical': 0.0028793550244745176, 'mean_word_length': 5.181494661921708, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '6081392', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1018, 'n_words': 225}