我正在寻找解决奇怪问题的方法.我有一个控制器,需要身份验证(与设计宝石).我添加了Devise TestHelpers,但我无法让它工作.
require 'test_helper'
class KeysControllerTest < ActionController::TestCase
include Devise::TestHelpers
fixtures :keys
def setup
@user = User.create!(
:email => 'testuser@demomailtest.com',
:password => 'MyTestingPassword',
:password_confirmation => 'MyTestingPassword'
)
sign_in @user
@key = keys(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:keys)
end
test "should get new" do
get :new
assert_response :success
end
test "should create key" do
assert_difference('Key.count') do
post :create, :key => @key.attributes
end
assert_redirected_to key_path(assigns(:key))
end
test "should destroy key" do
assert_difference('Key.count', -1) do
delete …Run Code Online (Sandbox Code Playgroud) 我正在寻找一个解决方案,从我的TYPO3扩展的TCA.php构建一个前端表单.
有没有办法,从我的扩展类中选择TCA.php值?我想用TCA.php文件的值构建一个select元素.
会有惊人的,如果有人能给我一些建议:)