<commit_before># Linda: This is where our step definitions live.
# Linda: Let's not try to have low-level step definitions
#        (https://github.com/cucumber/cucumber-rails/issues/174)
# Linda: We can totally do better! 

Given /^the following projects exist$/ do |project_table|
  project_table.hashes.each do |project|
    Project.create(project)
  end
end

And /^the following users exist$/ do |user_table|
  user_table.hashes.each do |user|
    User.create(user)
  end
end

And /^the following announcements exist$/ do |announcement_table|
  announcement_table.hashes.each do |announcement|
    Announcement.create(announcement)
  end
end
<commit_msg>cucumber sadness<commit_after># Linda: This is where our step definitions live.
# Linda: Let's not try to have low-level step definitions
#        (https://github.com/cucumber/cucumber-rails/issues/174)
# Linda: We can totally do better! 

And /^the following announcements exist$/ do |announcement_table|
  announcement_table.hashes.each do |announcement|
    Announcement.create(announcement)
  end
end

Given /^(?:|I) am not logged in$/ do |user|
  #nothing needs to be done.. 
  end

Given /^(?:|I) am logged in as "(.*?)" $/ do |user|
  password = <PASSWORD>
  visit login_path
  fill_in "user_email", :with => user
  fill_in "user_password", :with => password
  click_button "Log in"
end

And /^(?:|I) visit the home page$/ do |page_to_visit|
  visit home_path 
end

Then /^(?:|I) should see the splash page$/ do |page|
  page.should have_content 'Welcome to Snap!'
end 

Then /^(?:|I) should see the dashboard page$/ do |page|
  page.should have_content 'Dashboard'
end 

And /^(?:|I) should see a news feed with my "(.*?)"$/ do |announcements| 
end

And /^(?:|I) should see a projects listing with my "(.*?)"$/ do |projects|
end

Then /^(?:|I) will be on the snap page$/ do |target|
  page.current_path.should eq "/snap/"
end

Then /^(?:|I) will be on the help page$/ do |target|
  page.current_path.should eq "/help"
end

Then /^(?:|I) will be on the about snap page$/ do |target|
  page.current_path.should eq "/about"
end

Then /^(?:|I) will be on the profile page for "(.*?)"$/ do |target|
  usr = User.find_by_username target
  page.current_path.should eq "/users/" + usr.id.to_s
end

Then /^(?:|I) should be logged out$/ do |target|
  page.current_path.should eq "/"
  page.should have_content 'Sign In'
end
{'fraction_non_alphanumeric': 0.13619167717528374, 'fraction_numerical': 0.0025220680958385876, 'mean_word_length': 3.817813765182186, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '6525155', 'n_tokens_mistral': 841, 'n_tokens_neox': 805, 'n_words': 281}