2014-02-25 44 views

回答

0

您應該可以在容器中重新註冊它。

App.__container__.register('adapter:application', DS.FixtureAdapter); 

而取決於你如何運行你的測試,你可以,如果你打電話App.reset()能夠把直接在App命名空間。

App.ApplicationAdapter = DS.FixtureAdapter; 
+0

不幸的是沒有這些工作:註冊不做任何事情,應用程序不公開ApplicationAdapter – jasalguero

+0

您可能需要先調用'unregister'。儘管如此,很難確定你的問題。你能否詳細說明你如何測試應用程序?也許給一個樣本測試? – GJK

+0

該應用程序正在使用EmberApp Kit,測試與此處完全相同:https://github.com/stefanpenner/ember-app-kit-todos/blob/master/tests/acceptance/todos_test.js主要的區別是在那個項目中,他們從一開始就使用FixtureAdapter,所以他們不必切換 – jasalguero

相關問題