私は1つの仕様と一つの工場を持っていると私はこのエラーを取得しています:RSpecのとFactoryGirl:SystemStackError:スタックレベルが深すぎレール
SystemStackError: stack level too deep
from gems/activerecord-4.2.1/lib/active_record/relation/delegation.rb:9:in `relation_delegate_class'
私はverbageを使用しようとすると、それが動作する「構築」;私はデータをテストするためにそれを保存する必要がありますし、そのエラーを解決するように '作成'はlet!(:user) { create(:user) }
で動作しません。 Rspecは正常に動作するようです。
私はruby 2.2.2を実行しています。セットアップ組合に対するRSpecの、工場の少女
require 'spec_helper'
describe API::V1::CurrentUserController do
let!(:user) { create(:user) }
setup_api_authorization
describe "GET 'show'" do
before (:each) do
setup_api_headers
get 'show', subdomain: 'api', id: 'me'
end
end
FactoryGirl.define do
factory :user, aliases: [:participant] do
sequence(:email) { |n| "user#{n}@example.com" }
first_name { Faker::Name.first_name }
last_name { Faker::Name.last_name }
password 'testpass'
password_confirmation { |user| user.password }
role_id {4}
end
end
あなた 'User'モデルを提示してください。 'after_create'、' after_commit'などのコールバックはありますか? –
specユーザーモデルまたはapp – eWadeMan
モデルの 'app/models'です。 –