# encoding: utf-8 describe <%= project.type %>::<%= policy.type %> do # The specification checks whether the policy object is valid or not, # depending on values of its attributes. # default attributes for a valid policy <% attributes.each do |item| -%> # let(:<%= item.name %>) { @todo } <% end -%> subject do described_class.new( <% attributes.each do |item| -%> <%= item.name %>: <%= item.name %>, <% end -%> ) end <% attributes.each do |item| -%> describe "#<%= item.name %>" do it "is initialized" do expect(subject.<%= item.name %>).to eq <%= item.name %> end end # describe #<%= item.name %> <% end -%> describe "#valid?" do context "when @todo: describe the context" do it { is_expected.to be_valid } end # context <% attributes.each do |item| -%> context "when the #<%= item.name %> is @todo" do # before { allow(subject).to receive(:<%= item.name %>) { @todo } } it { is_expected.to be_invalid } end # context <% end -%> end # describe #valid? end # describe <%= policy.type %>