- @lol2 = Factory :license, :name => 'peta2.1', :url => 'http://test.ptn/21'
- @ol2 = Factory :original_license, :license_id => @lol2.id, :name => 'peta2.1', :url => 'http://test.ptn/21'
- @lol3 = Factory :license, :name => 'peta2.2', :url => 'http://test.ptn/22'
- @ol3 = Factory :original_license, :license_id => @lol3.id, :name => 'peta2.2', :url => 'http://test.ptn/22'
- @lol4 = Factory :license, :name => 'peta2.3', :url => 'http://test.ptn/23'
- @ol4 = Factory :original_license, :license_id => @lol4.id, :name => 'peta2.3', :url => 'http://test.ptn/23'
- @lol5 = Factory :license, :name => 'peta2.4', :url => 'http://test.ptn/24'
- @ol5 = Factory :original_license, :license_id => @lol5.id, :name => 'peta2.4', :url => 'http://test.ptn/24'
- License.stub(:default_page_size).and_return(2)
- end
- it '通常は2件を返す' do
- l = License.list
- l.should have(2).items
- end
- it 'page=1なら末尾2件を返す' do
- #名前順で並んでいる
- l = License.list( {}, 1)
- l.should eq [@lcl, @lol2]
- end
- it 'page=2なら中間2件を返す' do
- l = License.list({}, 2)
- l.should eq [@lol3, @lol4]
- end
- it 'page=3なら先頭1件を返す' do
- l = License.list({}, 3)
- l.should eq [@lol5]
+ License.stub(:replace_system_picture).with(any_args).and_return(false)
+ License.stub(:modify_object).with(any_args).and_return(License.new)
+ end
+ it '全体エラーメッセージがセットされている' do
+ r = License.store(@ln, @la)
+ r.errors[:base].should_not be_blank
+ end
+ it 'ライセンスが作成されていない' do
+ lambda {
+ r = License.store(@ln, @la)
+ }.should_not change License, :count