Sha256: 7f203faa3ad648d60c2ad95de3cf46da1ddf2d089b58bd6e63183878945b17e8

Contents?: true

Size: 659 Bytes

Versions: 8

Compression:

Stored size: 659 Bytes

Contents

require '<%= File.exists?('spec/rails_helper.rb') ? 'rails_helper' : 'spec_helper' %>'

describe <%= class_name %>Policy do
  let(:model) { } # <%= class_name %>.new
  subject { described_class.new(user, model)  }

  context 'when a standard user' do
    let(:user) { User.new }

    # it { is_expected.to permit_auth(:action) }
  end

  context 'when an anon user' do
    let(:user) { User.new }

    # it { is_expected.to_not permit_auth(:action) }
  end

  describe <%= class_name %>Policy::Scope do
    context 'when a standard user' do
      let(:user) { } # User.new
    end

    context 'when a anon user' do
      let(:user) { nil }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
natural_resource-0.2.0 lib/generators/rspec/templates/policy_spec.rb
natural_resource-0.1.6 lib/generators/rspec/templates/policy_spec.rb
natural_resource-0.1.5 lib/generators/rspec/templates/policy_spec.rb
natural_resource-0.1.4 lib/generators/rspec/templates/policy_spec.rb
natural_resource-0.1.2 lib/generators/rspec/templates/policy_spec.rb
natural_resource-0.1.2.pre.3 lib/generators/rspec/templates/policy_spec.rb
natural_resource-0.1.2.pre.2 lib/generators/rspec/templates/policy_spec.rb
natural_resource-0.1.2.pre lib/generators/rspec/templates/policy_spec.rb