<commit_before>require "test_helper"

class UserFlowsTest < ActionDispatch::IntegrationTest
  setup do
    Capybara.current_driver = Capybara.javascript_driver # :seleniun by default

  end

def creation()
   visit "/users/new"
    fill_in :user_name, :with => "example" 
    click_button "Create User"
end

  test "create user" do
    creation()
   	#visit "/users/new"
	  #fill_in :user_name, :with => "example" 
  	#click_button "Create User"
    #after_create = path 
    #click_link "Back"
    #assert_redirected_to(:controller => "users", :action => "show")
    #find("tr", :text => "example").click_link "Show"
    #click_link "Back"
    #assert page.has_text?("waaaaaaaaaaaaa"), "hola"
    assert page.has_content?("example") 
    #assert after_create == path 
	end

  test "check user" do
    creation()
    click_link "Back"
    assert page.has_content?("example") 
  end


  test "show user" do
    visit "/users"
    #show_link = first("a", :text => "Show")
    first(:link, "Show").click
    #show_link = path 
    #assert path == show_link
    #page.assert_selector("p", :text => "Nombre: cosa", :visible => true)
    sleep(2)
    assert page.has_text?("name") #:exact => true

  end

  test "edit user" do
    visit "/users"
    first(:link, "Edit").click
    fill_in :user_name, :with => "name" 
    click_button "Update User"
    #click_link "Back"
    assert page.has_text?("name")
  end

  test "delete user" do
    visit "/users"
    first(:link, "Delete").click
    accept_alert()
    assert_not page.has_content?("User1")
   end
end

<commit_msg>integration test without coments and operational<commit_after>require "test_helper"

class UserFlowsTest < ActionDispatch::IntegrationTest
  setup do
    Capybara.current_driver = Capybara.javascript_driver # :seleniun by default

  end

def creation()
   visit "/users/new"
    fill_in :user_name, :with => "example" 
    click_button "Create User"
end

  test "create user" do
    creation()
   	assert page.has_content?("example") 
    
	end

  test "check user" do
    creation()
    click_link "Back"
    assert page.has_content?("example") 
  end


  test "show user" do
    visit "/users"
    
    first(:link, "Show").click
    sleep(2)
    assert page.has_text?("name") 

  end

  test "edit user" do
    visit "/users"
    first(:link, "Edit").click
    fill_in :user_name, :with => "name" 
    click_button "Update User"
    assert page.has_text?("name")
  end

  test "delete user" do
    visit "/users"
    first(:link, "Delete").click
    accept_alert()
    assert_not page.has_content?("User1")
   end
end


{'fraction_non_alphanumeric': 0.13127413127413126, 'fraction_numerical': 0.0015444015444015444, 'mean_word_length': 3.2545155993431854, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '1348413', 'n_tokens_mistral': 896, 'n_tokens_neox': 860, 'n_words': 225}