spec/proxy_spec.rb in heimdallr-1.0.0 vs spec/proxy_spec.rb in heimdallr-1.0.1
- old
+ new
@@ -107,9 +107,15 @@
article = Article.create! :owner_id => @john.id, :content => 'test', :secrecy_level => 4
expect { article.restrict(@looser).secrecy_level }.should raise_error
article.restrict(@looser).implicit.secrecy_level.should == nil
end
+ it "should answer if object is creatable" do
+ Article.restrict(@john).creatable?.should == true
+ Article.restrict(@admin).creatable?.should == true
+ Article.restrict(@looser).creatable?.should == true
+ end
+
it "should answer if object is modifiable" do
article = Article.create! :owner_id => @john.id, :content => 'test', :secrecy_level => 4
article.restrict(@john).modifiable?.should == true
article.restrict(@admin).modifiable?.should == true
article.restrict(@looser).modifiable?.should == false
\ No newline at end of file