<commit_before>package controllers.s8_other_money

import org.specs2.mutable.Specification
import org.specs2.mutable.Tags

import controllers.ClaimScenarioFactory
import utils.pageobjects.ClaimScenario
import utils.pageobjects.PageObjectException
import utils.pageobjects.s2_about_you.G4ClaimDatePageContext
import utils.pageobjects.s8_other_money._
import play.api.test.WithBrowser

class G3PersonWhoGetsThisMoneyIntegrationSpec extends Specification with Tags {

  "Person Who Gets This Money" should {
    "be presented" in new WithBrowser with G4PersonContactDetailsPageContext {
      page goToThePage()
    }

    "be skipped if nobody had any money added to a benefit for you" in new WithBrowser with G2MoneyPaidToSomeoneElseForYouPageContext {
      val claim = ClaimScenarioFactory.s8otherMoney
      claim.OtherMoneyHasAnyoneHadMoneyForBenefitYouClaim = "no"
      page goToThePage()
      page fillPageWith claim
      val g3Page = page.submitPage()
      g3Page must not(beAnInstanceOf[G3PersonWhoGetsThisMoneyPage])
    }

    "contain errors on invalid submission" in new WithBrowser with G3PersonWhoGetsThisMoneyPageContext {
      page goToThePage()
      page fillPageWith new ClaimScenario
      val pageWithErrors = page.submitPage()
      pageWithErrors.listErrors.size mustEqual 2
    }

    "contain the completed forms" in new WithBrowser with G2MoneyPaidToSomeoneElseForYouPageContext {
      val claim = ClaimScenarioFactory.s8otherMoney
      claim.OtherMoneyHasAnyoneHadMoneyForBenefitYouClaim = "yes"
      page goToThePage()<commit_msg>fixed present test for G3<commit_after>package controllers.s8_other_money

import org.specs2.mutable.Specification
import org.specs2.mutable.Tags

import controllers.ClaimScenarioFactory
import utils.pageobjects.ClaimScenario
import utils.pageobjects.PageObjectException
import utils.pageobjects.s2_about_you.G4ClaimDatePageContext
import utils.pageobjects.s8_other_money._
import play.api.test.WithBrowser

class G3PersonWhoGetsThisMoneyIntegrationSpec extends Specification with Tags {

  "Person Who Gets This Money" should {
    "be presented" in new WithBrowser with G3PersonWhoGetsThisMoneyPageContext {
      page goToThePage()
    }

    "be skipped if nobody had any money added to a benefit for you" in new WithBrowser with G2MoneyPaidToSomeoneElseForYouPageContext {
      val claim = ClaimScenarioFactory.s8otherMoney
      claim.OtherMoneyHasAnyoneHadMoneyForBenefitYouClaim = "no"
      page goToThePage()
      page fillPageWith claim
      val g3Page = page.submitPage()
      g3Page must not(beAnInstanceOf[G3PersonWhoGetsThisMoneyPage])
    }

    "contain errors on invalid submission" in new WithBrowser with G3PersonWhoGetsThisMoneyPageContext {
      page goToThePage()
      page fillPageWith new ClaimScenario
      val pageWithErrors = page.submitPage()
      pageWithErrors.listErrors.size mustEqual 2
    }

    "contain the completed forms" in new WithBrowser with G2MoneyPaidToSomeoneElseForYouPageContext {
      val claim = ClaimScenarioFactory.s8otherMoney
      claim.OtherMoneyHasAnyoneHadMoneyForBenefitYouClaim = "yes"
      page goToThePage()
{'fraction_non_alphanumeric': 0.048982188295165395, 'fraction_numerical': 0.0111323155216285, 'mean_word_length': 4.666666666666667, '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': '1894027', 'n_tokens_mistral': 952, 'n_tokens_neox': 898, 'n_words': 225}