這是我的問題,我添加來自功能測試控制器的會話變量,他們不會彈出測試目標的行動。 。 我做了一個登錄方法和使用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