Sha256: 34658e28c55d81b36a469cfa35fad98c4cc894ea7d54e09a68889233729ad1c9
Contents?: true
Size: 1.12 KB
Versions: 5
Compression:
Stored size: 1.12 KB
Contents
shared_examples_for "Common Cache API" do describe '#invalidate_role_cache!' do before :each do user.role_list user.invalidate_role_cache! end # should invalidate role cache, forcing update of @role_list instance var expect { user.role_list }.to change { user.instance_variable_get "@role_list" } end end # specify { user.role_list.should == [:admin, :blogger] } # it { should be_valid } # its(:errors) { should be_empty } # ################################################################################ # # specify (generated descriptions) # # instead of repeating expectation with: it "should not be published"...) # specify { blog_post.should_not be_published } # # ################################################################################ # # subject (delegate should/should_not to subject) # subject { BlogPost.new :title => 'foo', :body => 'bar' } # it "sets published timestamp" do # subject.publish! # subject.should be_published # end # # it { should be_valid } # its(:errors) { should be_empty } # its(:title) { should == 'foo' }
Version data entries
5 entries across 5 versions & 1 rubygems