end
context 'コミックで引っかかるとき' do
it 'falseを返す' do
- @story.comic_id = nil
+ Panel.any_instance.stub(:usable?).with(any_args).and_return(true)
+ Comic.any_instance.stub(:own?).with(any_args).and_return(false)
r = @story.allow?
r.should be_false
end
+ end
+ context 'コマで引っかかるとき' do
it 'falseを返す' do
- Comic.any_instance.stub(:own?).with(any_args).and_return(false)
+ Comic.any_instance.stub(:own?).with(any_args).and_return(true)
+ Panel.any_instance.stub(:usable?).with(any_args).and_return(false)
r = @story.allow?
r.should be_false
end
end
- context 'コマで引っかかるとき' do
- it 'falseを返す' do
+ context 'コミックまたはコマが指定されていなかったとき' do
+ it 'nilを返す' do
+ Comic.any_instance.stub(:own?).with(any_args).and_return(true)
@story.panel_id = nil
r = @story.allow?
- r.should be_false
+ r.should eq nil
end
- it 'falseを返す' do
- Panel.any_instance.stub(:usable?).with(any_args).and_return(false)
+ it 'nilを返す' do
+ Panel.any_instance.stub(:usable?).with(any_args).and_return(true)
+ @story.comic_id = nil
r = @story.allow?
- r.should be_false
+ r.should eq nil
end
end
end