<commit_before>Given(/^there is a game$/) do
  GameTestHelper.create_game
end

Given(/^there is another game$/) do
  GameTestHelper.create_game(title: "Second game")
end

Given(/^there is a game one week ago$/) do
  GameTestHelper.create_game(start_date: 1.week.ago)
end

Given(/^there is a game in the past$/) do
  if Date.today > new Date(2018,1,7)
    GameTestHelper.create_game(start_date: 1.year.ago)
  else
    GameTestHelper.create_game(start_date: new Date(2018,1,10))
  end
end

Given(/^the user is a GM for the game$/) do
  GameTestHelper.add_gamesmaster User.first, to: Game.first
end

Given(/^the user is a player of the game$/) do
  user = UserTestHelper.create_or_find_user
  character = CharacterTestHelper.create_character(user)
  CharacterTestHelper.approve_character(user)
  GameTestHelper.add_player user, character, to: Game.first
end

Given(/^the user is a monster of the game$/) do
  user = UserTestHelper.create_or_find_user
  GameTestHelper.add_monster user, to: Game.first
end

Given(/^the other user is a player of the game$/) do
  user = UserTestHelper.create_or_find_another_user
  character = CharacterTestHelper.create_character(user)
  CharacterTestHelper.approve_character(user)
  GameTestHelper.add_player user, character, to: Game.first
end

Given(/the other user has been created for the game$/) do
  user = User.all.second<commit_msg>Fixing failing tests.<commit_after>Given(/^there is a game$/) do
  GameTestHelper.create_game
end

Given(/^there is another game$/) do
  GameTestHelper.create_game(title: "Second game")
end

Given(/^there is a game one week ago$/) do
  GameTestHelper.create_game(start_date: 1.week.ago)
end

Given(/^there is a game in the past$/) do
  if Date.today > new Date(2018,1,7)
    GameTestHelper.create_game(start_date: 1.year.ago)
  else
    GameTestHelper.create_game(start_date: new Date(2017,1,10))
  end
end

Given(/^the user is a GM for the game$/) do
  GameTestHelper.add_gamesmaster User.first, to: Game.first
end

Given(/^the user is a player of the game$/) do
  user = UserTestHelper.create_or_find_user
  character = CharacterTestHelper.create_character(user)
  CharacterTestHelper.approve_character(user)
  GameTestHelper.add_player user, character, to: Game.first
end

Given(/^the user is a monster of the game$/) do
  user = UserTestHelper.create_or_find_user
  GameTestHelper.add_monster user, to: Game.first
end

Given(/^the other user is a player of the game$/) do
  user = UserTestHelper.create_or_find_another_user
  character = CharacterTestHelper.create_character(user)
  CharacterTestHelper.approve_character(user)
  GameTestHelper.add_player user, character, to: Game.first
end

Given(/the other user has been created for the game$/) do
  user = User.all.second
{'fraction_non_alphanumeric': 0.09570596797671034, 'fraction_numerical': 0.010917030567685589, 'mean_word_length': 4.8241525423728815, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4540468', 'n_tokens_mistral': 944, 'n_tokens_neox': 901, 'n_words': 261}