From 30134aab1f75587a077fe889e9ddfb86a401bcb4 Mon Sep 17 00:00:00 2001 From: weslleylmurdock Date: Fri, 7 Oct 2022 20:29:23 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20tradu=C3=A7=C3=A3o=20do=20t=C3=B3pico?= =?UTF-8?q?=2017.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt-BR/testing.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pt-BR/testing.md b/pt-BR/testing.md index c2ac24be2..73d0d0d58 100644 --- a/pt-BR/testing.md +++ b/pt-BR/testing.md @@ -2030,25 +2030,25 @@ RSpec.describe "Zeitwerk compliance" do end ``` -Additional Testing Resources +Recursos de teste adicionais ---------------------------- -### Testing Time-Dependent Code +### Testando código Time-Dependent -Rails provides built-in helper methods that enable you to assert that your time-sensitive code works as expected. +O Rails fornece métodos auxiliares integrados que permitem garantir que seu código time-sensitive funciona conforme o esperado. -Here is an example using the [`travel_to`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/TimeHelpers.html#method-i-travel_to) helper: +Aqui está um exemplo utilizando o helper [`travel_to`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/TimeHelpers.html#method-i-travel_to): ```ruby -# Lets say that a user is eligible for gifting a month after they register. +# Digamos que um usuário seja elegível para presentear um mês depois de se registrar. user = User.create(name: "Gaurish", activation_date: Date.new(2004, 10, 24)) assert_not user.applicable_for_gifting? travel_to Date.new(2004, 11, 24) do - assert_equal Date.new(2004, 10, 24), user.activation_date # inside the `travel_to` block `Date.current` is mocked + assert_equal Date.new(2004, 10, 24), user.activation_date # dentro do bloco `travel_to`, `Date.current` é simulado assert user.applicable_for_gifting? end -assert_equal Date.new(2004, 10, 24), user.activation_date # The change was visible only inside the `travel_to` block. +assert_equal Date.new(2004, 10, 24), user.activation_date # A mudança era visível apenas dentro do bloco `travel_to`. ``` -Please see [`ActiveSupport::Testing::TimeHelpers` API Documentation](https://api.rubyonrails.org/classes/ActiveSupport/Testing/TimeHelpers.html) -for in-depth information about the available time helpers. +Por favor veja a documentação da API [`ActiveSupport::Testing::TimeHelpers`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/TimeHelpers.html) +para obter informações detalhadas sobre os time helpers disponíveis.