diff --git a/test/controllers/translations_controller_test.rb b/test/controllers/admin/translations_controller_test.rb
similarity index 70%
rename from test/controllers/translations_controller_test.rb
rename to test/controllers/admin/translations_controller_test.rb
index 335dd55..8b03371 100644
--- a/test/controllers/translations_controller_test.rb
+++ b/test/controllers/admin/translations_controller_test.rb
@@ -1,8 +1,9 @@
require "test_helper"
-class TranslationsControllerTest < ActionDispatch::IntegrationTest
+class Admin::TranslationsControllerTest < ActionDispatch::IntegrationTest
test "#create with a valid Translation persists it to the I18n backend" do
with_translations en: { key: "value" } do
+ post sessions_path
post translations_path, params: {
translation: { locale: :en, key: "key", value: "new value" }
}
@@ -14,6 +15,7 @@ class TranslationsControllerTest < ActionDispatch::IntegrationTest
test "#create with an valid Translation responds with an error" do
with_translations en: {} do
+ post sessions_path
post translations_path, params: {
translation: { locale: :en, key: "missing", value: "" }
}
@@ -21,4 +23,10 @@ class TranslationsControllerTest < ActionDispatch::IntegrationTest
assert_response :unprocessable_entity
end
end
+
+ test "#create without authenticating responds with a Not Found status" do
+ post translations_path
+
+ assert_response :forbidden
+ end
end