这是我的问题,我添加来自功能测试控制器的会话变量,他们不会弹出测试目标的行动。 。 我做了一个登录方法和使用cookbook advice登录我调整了一点,让2个帐户登录:admin和超级管理员 /**
* @param $account string the account to log in with (authorized : superadmin and admin)
rspec context "No user logged in" do
it "redirects to login" do
get :show, id: @user.id
expect(response).to redirect_to("/login")
end
end
end
末 不知道是哪里不对
据this documentation,我可以在我的测试类写一个setUp()功能,如: use Doctrine\ORM\Tools\SchemaTool;
use Liip\FunctionalTestBundle\Test\WebTestCase;
class AccountControllerTest extends WebTestCase
{
public functi