所以这是我的工厂:
Animation.prototype.onUpdate = function onUpdate () {
// while the transitionable is still transitioning
// keep requesting updates
if (this.xPosition.isActive()) {
// set the position of the component's node
// every frame to the value of the transitionable
this.node.setPosition(this.xPosition.get(), 0, 0);
this.node.requestUpdateOnNextTick(this.id);
}
};
这是我的规范:
FactoryGirl.define do
factory :member do
email 'admin@admin.com'
password 'rootroot'
first_name 'Rinholds'
last_name 'Jordan'
expiration Time.local(2015, 6, 21, 15, 13, 0)
start_date Time.local(2015, 4, 21, 15, 13, 0)
role 2
end
end
这是我的root_path():
require 'rails_helper'
describe DashboardController, type: :controller do
it 'should display chart', js: true do
member = create(:member)
member.save!
member.confirm
binding.pry
visit '/'
end
end
当我运行spec时,它返回nil的未定义方法`email':视图中的NilClass。
当我在视图中放置绑定pry,并运行Member.all时,它返回空数组!
那怎么可能?如何强制factorygirl创建真正的数据库数据?!?
- 编辑 - 这是控制器,但它甚至没有到达那里,因为设计登录页面authorized_member!
body
= yield
= Member.first.email
~
答案 0 :(得分:0)
通过安装databsecleaner解决了这个问题!会员数据现在显示在控制器和视图中!!!