Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DFOP PHTG - Atividade 5 #255

Merged
merged 9 commits into from
Feb 5, 2014
Merged

DFOP PHTG - Atividade 5 #255

merged 9 commits into from
Feb 5, 2014

Conversation

pedrootorres
Copy link
Contributor

Pull Request dos alunos:
Dyego Felipe de Oliveira Penha
Pedro Henrique Torres Gonçalves

Cenários de GUI e de controlador criados para a feature de 'news'.

Issue #252 criada e corrigida. Um novo cenário foi criado para cobrir ela.

OBS: pull request corrigido removendo os arquivos que foram enviados incorretamente.

Date dateAsDateObj = Date.parse("dd-MM-yyyy", date)
def researchGroup = ResearchGroup.findByName(group)
NewsTestDataAndOperations.createNews(description, dateAsDateObj, researchGroup)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E se a data não for válida? O teste passa? Não deveria, certo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No passo 'when', se a data nao for válida, a news não será criada. Quando chegar no passo 'then', ele vai verificar se a news não foi armazenada no sistema (porque a data é inválida). Se ela de fato não foi armazenada, o teste passa.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, então apenas ajusta

I create a news -> I try to create a news 

para que a implementação do passo reflita melhor a sua descrição.

On Jan 30, 2014, at 3:05 PM, pedrootorres [email protected] wrote:

In test/cucumber/steps/NewsSteps.groovy:

@@ -14,9 +16,11 @@ Given(~'^the system has no news with description "([^"])" and date "([^"])" fo
}

When(~'^I create a news with description "([^"])" and date "([^"])" for "([^"]*)" research group$') { String description, String date, String group ->

  • Date dateAsDateObj = Date.parse("dd-MM-yyyy", date)
  • def researchGroup = ResearchGroup.findByName(group)
  • NewsTestDataAndOperations.createNews(description, dateAsDateObj, researchGroup)
  • if(NewsTestDataAndOperations.checkValidDate(date)) {
  •    Date dateAsDateObj = Date.parse("dd-MM-yyyy", date)
    
  •    def researchGroup = ResearchGroup.findByName(group)
    
  •    NewsTestDataAndOperations.createNews(description, dateAsDateObj, researchGroup)
    
  • }
    No passo 'when', se a data nao for válida, a news não será criada. Quando chegar no passo 'then', ele vai verificar se a news não foi armazenada no sistema (porque a data é inválida). Se ela de fato não foi armazenada, o teste passa.


Reply to this email directly or view it on GitHub.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrigido

@pauloborba pauloborba merged commit 9f9e38d into spgroup:master Feb 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants