Test Your Knowledge!
Take this quiz to test what you've learned in this chapter.
Quiz on testing macros.
1
Take the following module as reference:
defmodule I18n do
use Translator
locale "hp",
flash: [
disclaimer: [
notice: "Wizards are %{adjective},
],
],
wizards: [
name: "Harry",
]
Which of the following test cases could be used for testing if the wizards
field gives the correct output?
A)
test "Wizards test" do
assert I18n.t("hp", "wizards.name", adjective: "amazing") ==
"Wizards"
end
B)
test "Wizards test" do
assert I18n.t("hp", "wizards.disclaimer", name: "Harry") ==
"Harry"
end
C)
test "Wizards test" do
assert I18n.t("hp", "wizards.name") ==
"Harry"
end
Question 1 of 60 attempted
Get hands-on with 1300+ tech skills courses.