1
0
mirror of https://github.com/projekteuler/projekteuler.git synced 2026-01-26 18:18:51 +01:00

Make translations a nested resource for each problem

This commit is contained in:
2014-12-30 17:12:50 +01:00
parent 37f4eefff2
commit b16a04973a
7 changed files with 18 additions and 14 deletions

View File

@@ -6,7 +6,6 @@ class TranslationsControllerTest < ActionController::TestCase
@update = {
title: 'New title',
content: 'This is the new content',
problem_id: 1
}
end
@@ -17,13 +16,13 @@ class TranslationsControllerTest < ActionController::TestCase
end
test "should get new" do
get :new
get :new, problem_id: 1
assert_response :success
end
test "should create translation" do
assert_difference('Translation.count') do
post :create, translation: @update
post :create, problem_id: 1, translation: @update
end
assert_redirected_to translation_path(assigns(:translation))