firebase 3 を更新する前は、受け入れテストは問題なく実行されていました。beforeTestとafterTestで以下を使用します
moduleForAcceptance('Acceptance | Dashboard | Items | Library | New', {
beforeEach() {
stubFirebase();
var ref = createOfflineRef(basicDataRef, 'https://MY-APP.firebaseio.com');
replaceAppRef(this.application, ref);
stubValidSession(this.application, {uid: 'xxxx'});
},
afterEach() {
unstubFirebase();
}
});
basicDataRef はテスト用のフィクスチャです。上記のコードにより、torii ライブラリの test-helper に続くモック セッションが可能になり、firebase 階層が次のようになっているため、アプリケーションが必要なデータを正しく取得できるようになります。
私は許可ルールをテストしていません。アプリケーションでデータを保存/編集するための相互作用だけです。これはfirebase 3の移行前に問題なく機能していました。バージョン 3 以降、すべてのテストで次の結果が返されます。
actual: >
false
expected: >
true
stack: >
at http://localhost:7357/assets/test-support.js:4130:12
at exports.default._emberTestingAdaptersAdapter.default.extend.exception (http://localhost:7357/assets/vendor.js:49473:7)
at onerrorDefault (http://localhost:7357/assets/vendor.js:41461:24)
at Object.exports.default.trigger (http://localhost:7357/assets/vendor.js:62212:11)
at http://localhost:7357/assets/vendor.js:63463:40
at Queue.invoke (http://localhost:7357/assets/vendor.js:10415:16)
message: >
Error: permission_denied at /xxxx/profile: Client doesn't have permission to access the desired data.
私は常に、emberfire の createOfflineRef を使用すると、ルール チェックをバイパスできると考えていました。permission_denied を返し続けるという事実は、非常に困惑しています。多分私はテストを再設計する必要がありますか?それとも、私はいつもこれに間違ってアプローチしていますか? どんな入力でも大歓迎です