describe OriginalPictureLicenseGroup do
before do
- Factory :admin
- @user = Factory( :user_yas)
+ FactoryGirl.create :admin
+ @user = FactoryGirl.create( :user_yas)
@author = @user.author
- @artist = Factory :artist_yas, :author_id => @author.id
- @other_user = Factory( :user_yas)
+ @artist = FactoryGirl.create :artist_yas, :author_id => @author.id
+ @other_user = FactoryGirl.create( :user_yas)
@other_author = @other_user.author
- @other_artist = Factory :artist_yas, :author_id => @other_author.id
- @sp = Factory :system_picture
- @lg = Factory :license_group
- @license = Factory :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
- @op = Factory :original_picture, :artist_id => @artist.id
+ @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
+ @sp = FactoryGirl.create :system_picture
+ @lg = FactoryGirl.create :license_group
+ @license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
+ @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
end
describe '検証に於いて' do
end
it 'オーソドックスなデータなら通る' do
- @ol = Factory.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
+ @ol = FactoryGirl.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
@ol.should be_valid
end
context 'original_picture_idを検証するとき' do
before do
- @ol = Factory.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
+ @ol = FactoryGirl.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
end
it 'テストデータの確認' do
@ol.original_picture_id = @op.id
end
context 'license_group_idを検証するとき' do
before do
- @ol = Factory.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
+ @ol = FactoryGirl.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
end
it 'テストデータの確認' do
@ol.license_group_id = @lg.id