end
it 'オーソドックスなデータなら通る' do
- @lg = Factory.build :license_group
+ @lg = FactoryGirl.build :license_group
@lg.should be_valid
end
context 'nameを検証するとき' do
before do
- @lg = Factory.build :license_group
+ @lg = FactoryGirl.build :license_group
end
it 'テストデータの確認' do
@lg.name = 'a'*50
@lg.should_not be_valid
end
it '重複していたら失敗する' do
- l = Factory :license_group
+ l = FactoryGirl.create :license_group
@lg.should_not be_valid
end
end
context 'classnameを検証するとき' do
before do
- @lg = Factory.build :license_group
+ @lg = FactoryGirl.build :license_group
end
it 'テストデータの確認' do
@lg.classname = 'a'*50
end
context 'captionを検証するとき' do
before do
- @lg = Factory.build :license_group
+ @lg = FactoryGirl.build :license_group
end
it 'テストデータの確認' do
@lg.caption = 'a'*30
end
context 'urlを検証するとき' do
before do
- @lg = Factory.build :license_group
+ @lg = FactoryGirl.build :license_group
end
it 'テストデータの確認' do
@lg.url = 'http://test.com/'
describe '単体取得に於いて' do
before do
- @lg = Factory :license_group
+ @lg = FactoryGirl.create :license_group
end
it '指定のコマを返す' do
l = LicenseGroup.show @lg.id
end
describe '一覧取得に於いて' do
before do
- @lg = Factory :license_group, :name => "1"
+ @lg = FactoryGirl.create :license_group, :name => "1"
end
it 'リストを返す' do
l = LicenseGroup.list
l.should eq [@lg]
end
it '名前順で並んでいる' do
- @lg2 = Factory :license_group, :name => "5", :url => 'http://test.ptn/10'
+ @lg2 = FactoryGirl.create :license_group, :name => "5", :url => 'http://test.ptn/10'
l = LicenseGroup.list
l.should eq [@lg, @lg2]
end