<commit_before>Given /^I have ordered some stuff$/ do
  Given %{a product named "Fish" in the category "Animals"}
  And %{a product named "Terminator T-1000" in the category "Cyborgs"}
  When %{I view the category "Animals"}
  And %{I add the only product in the category "Animals" to my cart 3 times}
  And %{I view the category "Cyborgs"}
  And %{I add the only product in the category "Cyborgs" to my cart 2 times}  
end

When /^I add the store's only product to my cart$/ do
  visit products_path
  fill_in "quantity", :with => 1
  click_button "Add to cart"
end

When /^I add the store's only product to my cart (\d+) times$/ do |num|
  visit products_path
  fill_in "quantity", :with => num
  click_button "Add to cart"
end

When /^I add the only product in the category "([^\"]*)" to my cart (\d+) times$/ do |cat, num|
  num.to_i.times do
    visit products_path
    click_link cat
    fill_in "quantity", :with => 1
    click_button "Add to cart"
  end
end

When /^I visit the checkout$/ do
  visit cart_path
  click_link "Weiter zur Kasse"
end

When /^I submit my order$/ do
  click_button "Bestellung aufgeben"
end

Then /^I should see an order summary$/ do
  # TODO: Right now we check for the German (Switzerland) text because that's the
  # default locale. In future, the default locale should be en_UK and we should check
  # both for that and for the German one, plus whether switching between the two works.
  page.should have_content("Zusammenfassung Ihrer Bestellung")
end

Then /^my cart should contain a product named "([^\"]*)"$/ do |arg1|
  visit cart_path
  page.should have_content(arg1)
end

Then /^my cart should contain a product named "([^\"]*)" (\d+) times$/ do |arg1, arg2|                                                                     
  visit cart_path
  page.should have_selector("input", :name => 'cart_line[quantity]', :value => arg2)
  page.should have_content(" x " + arg1)
end    

Then /^my cart should contain some stuff$/ do                                                         
      Then %{my cart should contain a product named "Fish" 3 times}
      And %{my cart should contain a product named "Terminator T-1000" 2 times}
end    

Then /^I should receive (\d+) e\-mails$/ do |num|
  @emails = ActionMailer::Base.deliveries
  @emails.count.should == num.to_i
end

Then /^the subject of e\-mail (\d+) should be "([^"]*)"$/ do |num, subject|
  # Adjust for human-readable numbers instead of index
  # positions used in the .feature text
  index = num.to_i - 1
  @emails[index].subject.should == subject
#   @email.from.should == "<EMAIL>"
#   @email.to.should == @user.email
#   @email.body.should include("some key word or something....")
  
end

<commit_msg>Had to change some test steps to German.<commit_after>Given /^I have ordered some stuff$/ do
  Given %{a product named "Fish" in the category "Animals"}
  And %{a product named "Terminator T-1000" in the category "Cyborgs"}
  When %{I view the category "Animals"}
  And %{I add the only product in the category "Animals" to my cart 3 times}
  And %{I view the category "Cyborgs"}
  And %{I add the only product in the category "Cyborgs" to my cart 2 times}  
end

When /^I add the store's only product to my cart$/ do
  visit products_path
  fill_in "quantity", :with => 1
  click_button "Kaufen"
end

When /^I add the store's only product to my cart (\d+) times$/ do |num|
  visit products_path
  fill_in "quantity", :with => num
  click_button "Kaufen"
end

When /^I add the only product in the category "([^\"]*)" to my cart (\d+) times$/ do |cat, num|
  num.to_i.times do
    visit products_path
    click_link cat
    fill_in "quantity", :with => 1
    click_button "Kaufen"
  end
end

When /^I visit the checkout$/ do
  visit cart_path
  click_link "Weiter zur Kasse"
end

When /^I submit my order$/ do
  click_button "Bestellung aufgeben"
end

Then /^I should see an order summary$/ do
  # TODO: Right now we check for the German (Switzerland) text because that's the
  # default locale. In future, the default locale should be en_UK and we should check
  # both for that and for the German one, plus whether switching between the two works.
  page.should have_content("Zusammenfassung Ihrer Bestellung")
end

Then /^my cart should contain a product named "([^\"]*)"$/ do |arg1|
  visit cart_path
  page.should have_content(arg1)
end

Then /^my cart should contain a product named "([^\"]*)" (\d+) times$/ do |arg1, arg2|                                                                     
  visit cart_path
  page.should have_selector("input", :name => 'cart_line[quantity]', :value => arg2)
  page.should have_content(" x " + arg1)
end    

Then /^my cart should contain some stuff$/ do                                                         
      Then %{my cart should contain a product named "Fish" 3 times}
      And %{my cart should contain a product named "Terminator T-1000" 2 times}
end    

Then /^I should receive (\d+) e\-mails$/ do |num|
  @emails = ActionMailer::Base.deliveries
  @emails.count.should == num.to_i
end

Then /^the subject of e\-mail (\d+) should be "([^"]*)"$/ do |num, subject|
  # Adjust for human-readable numbers instead of index
  # positions used in the .feature text
  index = num.to_i - 1
  @emails[index].subject.should == subject
#   @email.from.should == "<EMAIL>"
#   @email.to.should == @user.email
#   @email.body.should include("some key word or something....")
  
end


{'fraction_non_alphanumeric': 0.11198970209635896, 'fraction_numerical': 0.007723427730783376, 'mean_word_length': 2.9045226130653266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3214831', 'n_tokens_mistral': 1775, 'n_tokens_neox': 1660, 'n_words': 707}