0

ヘルパー クラスの rspec テストを実行しています。それらを高速化するために、FactorGirl と Rails のロードを回避したいと考えています。

私のヘルパー クラスは現在、Factory Girl を使用して User クラスと Project クラスからオブジェクトをインスタンス化しています。例えば:

describe '#show_follower_pic(user)' do
  it 'should show the profile pic when the user has one' do
    user = FactoryGirl.create(:user, profile_pic_source: 'facebook',facebook_uid: "22331111", facebook:  {"info"=>{"image"=>"test_image.png"}} )
    show_follower_pic(user).should == "test_image.png" 
  end

この特定のテスト ファイルの領域内にのみ存在する (より大きなテスト スイートではない) ユーザーとプロジェクトの偽のクラスを作成するにはどうすればよいですか?

4

0 に答える 0