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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user