spec/spec_helpers/examples/model.rb in protector-0.6.1 vs spec/spec_helpers/examples/model.rb in protector-0.6.2
- old
+ new
@@ -31,11 +31,10 @@
end
it "doesn't get stuck with non-existing tables" do
Rumba.class_eval do
protect do
- can
end
end
end
describe "visibility" do
@@ -84,9 +83,16 @@
context "with empty meta" do
before(:each) do
dummy.instance_eval do
protect do; end
end
+ end
+
+ it "handles empty creations" do
+ d = dummy.new.restrict!('!')
+ d.can?(:create).should == false
+ d.creatable?.should == false
+ d.should invalidate
end
it "marks blocked" do
d = dummy.new(string: 'bam', number: 1)
d.restrict!('!').creatable?.should == false
\ No newline at end of file