mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-27 02:28:50 +01:00
Rename Problem to Translation
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
require 'test_helper'
|
||||
|
||||
class ProblemsControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@problem = problems(:one)
|
||||
@update = {
|
||||
title: 'New title',
|
||||
content: 'This is the new content'
|
||||
}
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:problems)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create problem" do
|
||||
assert_difference('Problem.count') do
|
||||
post :create, problem: @update
|
||||
end
|
||||
|
||||
assert_redirected_to problem_path(assigns(:problem))
|
||||
end
|
||||
|
||||
test "should show problem" do
|
||||
get :show, id: @problem
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @problem
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update problem" do
|
||||
patch :update, id: @problem, problem: @update
|
||||
assert_redirected_to problem_path(assigns(:problem))
|
||||
end
|
||||
|
||||
test "should destroy problem" do
|
||||
assert_difference('Problem.count', -1) do
|
||||
delete :destroy, id: @problem
|
||||
end
|
||||
|
||||
assert_redirected_to problems_path
|
||||
end
|
||||
end
|
||||
53
test/controllers/translations_controller_test.rb
Normal file
53
test/controllers/translations_controller_test.rb
Normal file
@@ -0,0 +1,53 @@
|
||||
require 'test_helper'
|
||||
|
||||
class TranslationsControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@translation = translations(:one)
|
||||
@update = {
|
||||
title: 'New title',
|
||||
content: 'This is the new content'
|
||||
}
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:translations)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create translation" do
|
||||
assert_difference('Translation.count') do
|
||||
post :create, translation: @update
|
||||
end
|
||||
|
||||
assert_redirected_to translation_path(assigns(:translation))
|
||||
end
|
||||
|
||||
test "should show translation" do
|
||||
get :show, id: @translation
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @translation
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update translation" do
|
||||
patch :update, id: @translation, translation: @update
|
||||
assert_redirected_to translation_path(assigns(:translation))
|
||||
end
|
||||
|
||||
test "should destroy translation" do
|
||||
assert_difference('Translation.count', -1) do
|
||||
delete :destroy, id: @translation
|
||||
end
|
||||
|
||||
assert_redirected_to translations_path
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user