mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-26 18:18:51 +01:00
Update rails and code
This commit is contained in:
@@ -13,13 +13,13 @@ class Admin::DashboardControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
test "should post new problem count" do
|
||||
post :update_problem_count, problem_count: 15
|
||||
post :update_problem_count, params: { problem_count: 15 }
|
||||
assert_redirected_to controller: 'admin/dashboard', action: 'index'
|
||||
assert_equal 15, Problem.count
|
||||
end
|
||||
|
||||
test "should fail incorrect problem count" do
|
||||
post :update_problem_count, problem_count: 2
|
||||
post :update_problem_count, params: { problem_count: 2 }
|
||||
assert_redirected_to controller: 'admin/dashboard', action: 'index'
|
||||
assert_equal 3, Problem.count
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@ class Admin::TranslationsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
test "should show translation" do
|
||||
get :show, id: @translation
|
||||
get :show, params: { id: @translation }
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@ class ProblemsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
test "should get show" do
|
||||
get :show, id: 1
|
||||
get :show, params: { id: 1 }
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get untranslated problem" do
|
||||
get :show, id: 3
|
||||
get :show, params: { id: 3 }
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
|
||||
@@ -15,18 +15,18 @@ class TranslationsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
test "should get new for translated problem" do
|
||||
get :new, problem_id: 1
|
||||
get :new, params: { problem_id: 1 }
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new for untranslated problem" do
|
||||
get :new, problem_id: 3
|
||||
get :new, params: { problem_id: 3 }
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create translation" do
|
||||
assert_difference('Translation.count') do
|
||||
post :create, problem_id: 1, translation: @update
|
||||
post :create, params: { problem_id: 1, translation: @update }
|
||||
end
|
||||
|
||||
assert_redirected_to problem_path(id: 1)
|
||||
@@ -34,7 +34,7 @@ class TranslationsControllerTest < ActionController::TestCase
|
||||
|
||||
test "should not create incorrect translation" do
|
||||
assert_no_difference('Translation.count') do
|
||||
post :create, problem_id: 1, translation: @incorrect
|
||||
post :create, params: { problem_id: 1, translation: @incorrect }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user