Sha256: 7e29f6afbbb9e7b1aaca672845c3b7c7371e501c2d2e0e547433378875c8766a
Contents?: true
Size: 533 Bytes
Versions: 16
Compression:
Stored size: 533 Bytes
Contents
# Read about factories at https://github.com/thoughtbot/factory_girl def define_permission(action, model) perm = Faalis::Permission.find_by(permission_type: action, model: "Faalis::#{model.to_s.titleize}") perm || FactoryGirl.create("#{action}_#{model}") end FactoryGirl.define do [:index, :show, :update, :create, :destroy].each do |action| factory "#{action}_group".to_sym, :class => 'Faalis::Permission' do model 'Faalis::Group' permission_type action end end end
Version data entries
16 entries across 16 versions & 1 rubygems