Sha256: 3f4f008a7d223ae2689f143b151d113c419f9707ad8c34125d43c5f629d21d2f

Contents?: true

Size: 506 Bytes

Versions: 1

Compression:

Stored size: 506 Bytes

Contents

require "spec_helper"

RSpec.describe <%= klass %>, "#valid?" do
  subject(:policy) { described_class[<%= policy_signature.join(", ") %>] }

<% (parsed_params + parsed_options).each do |name| -%>
  let(:<%= name %>) { FactoryGirl.build :<%= name %> }
<% end -%>

  it { is_expected.to be_valid }
<% parsed_validators.each do |validator| %>
  it "is invalid when not <%= validator %>" do
    policy # modify it correspondingly
    expect { policy }.to be_invalid_at # add tags to check
  end
<% end -%>
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tram-policy-0.0.1 lib/tram/policy/generator/policy_spec.erb