<commit_before>When(/^I visit the shipping list for the next pod$/) do
  visit pod_shipments_path(@next_pod)
end

Then(/^I should see the user in the shipping list$/) do
  page.should have_text(@user.email)
end

Then(/^the shipment should be marked as shipped$/) do
  @user.shipments.first.shipped.should be_true
  page.should have_text("Shipped")
end

Then(/^the user should get a shipped email$/) do
  steps %{
    Then "#{@user.email}" should receive an email
    When they open the email
    Then they should see "Your SeedPod is on its way!" in the email subject
    And they should see "Hi #{@user.name}," in the email body
  }
end<commit_msg>Avoid test flicker by waiting for ajax action to happen<commit_after>When(/^I visit the shipping list for the next pod$/) do
  visit pod_shipments_path(@next_pod)
end

Then(/^I should see the user in the shipping list$/) do
  page.should have_text(@user.email)
end

Then(/^the shipment should be marked as shipped$/) do
  sleep(0.1) # wait for ajax action to happen before checking result
  @user.shipments.first.shipped.should be_true
  page.should have_text("Shipped")
end

Then(/^the user should get a shipped email$/) do
  steps %{
    Then "#{@user.email}" should receive an email
    When they open the email
    Then they should see "Your SeedPod is on its way!" in the email subject
    And they should see "Hi #{@user.name}," in the email body
  }
end
{'fraction_non_alphanumeric': 0.0965223562810504, 'fraction_numerical': 0.0014194464158978, 'mean_word_length': 3.8620689655172415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3737662', 'n_tokens_mistral': 438, 'n_tokens_neox': 429, 'n_words': 186}