<commit_before>Given /^the following users exist$/ do |table|
    User.create table.hashes
end

Given(/^I sign in with email "([^"]*)" and password "([^"]*)"$/) do |email, password|
  visit '/users/sign_in'
  fill_in "user_email", :with => email
  fill_in "user_password", :with => password
  click_button "Log in"
end

Given(/^I create a hospital with name "([^"]*)", surgeries "([^"]*)", and cost "([^"]*)"$/) do |name, surgeries, cost|
  Hospital.create(:name => name, :surgeries => surgeries, :cost => cost)
end

Given(/^I hide a hospital with name "([^"]*)"$/) do |hospital_name|
  h = Hospital.find_by(name: hospital_name)
  h.update(status: false)
end

Given(/^I update a hospital with name "([^"]*)", to have surgeries "([^"]*)"$/) do |hospital_name, hospital_surgeries|
  h = Hospital.find_by(name: hospital_name)
  h.update(surgeries: hospital_surgeries)
end<commit_msg>updating step definitions<commit_after>Given /^the following users exist$/ do |table|
    User.create table.hashes
end

Given(/^I sign in with email "([^"]*)" and password "([^"]*)"$/) do |email, password|
  visit '/users/sign_in'
  fill_in "user_email", :with => email
  fill_in "user_password", :with => password
  click_button "Log in"
end

Given(/^I create a hospital with name "([^"]*)", surgeries "([^"]*)", and cost "([^"]*)"$/) do |name, surgeries, cost|
  visit '/admin/hospital/new'
  fill_in "hospital_name", :with => name 
  fill_in "hospital_surgeries", :with => surgeries
  fill_in "hospital_cost", :with => cost
  click_button "Save"
end

Given(/^I hide a hospital with name "([^"]*)"$/) do |hospital_name|
  h = Hospital.find_by(name: hospital_name)
  visit '/admin/hospital/' + h.id.to_s + '/edit'
  uncheck 'hospital_status'
  click_button "Save"
end

Given(/^I update a hospital with name "([^"]*)", to have surgeries "([^"]*)"$/) do |hospital_name, hospital_surgeries|
  h = Hospital.find_by(name: hospital_name)
  visit '/admin/hospital/' + h.id.to_s + '/edit'
  fill_in "hospital_surgeries", :with => hospital_surgeries
  click_button "Save"
end
{'fraction_non_alphanumeric': 0.18710307767464582, 'fraction_numerical': 0.0, 'mean_word_length': 4.834757834757835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '1077455', 'n_tokens_mistral': 754, 'n_tokens_neox': 689, 'n_words': 197}