Sha256: 6761572df128eaeac17f43cd30c95eb829cef2d40e4808ac89ad3266b7ef5c59

Contents?: true

Size: 585 Bytes

Versions: 15

Compression:

Stored size: 585 Bytes

Contents

def owner_config context
  send :"#{context}_config"
end

def editor_config
  puts "editor config"
  
  @editor   = User.new(1, :editor, 'kristian')
  @ability  = Permits::Ability.new @editor
  @own_comment  = Comment.new(1)
  @other_comment  = Comment.new(2)
  @post     = Post.new(1)
  @article  = Article.new('kristian')      
end

def two_users_config 
  @editor         = User.new(1, :editor, "kristian")
  @other_guy      = User.new(1, :admin, "other")

  @ability        = Permits::Ability.new @editor

  @own_post       = Post.new(1)
  @other_post     = Post.new(2)      
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cancan-permits-0.3.12 spec/generic/api/owner/config.rb
cancan-permits-0.3.11 spec/generic/api/owner/config.rb
cancan-permits-0.3.10 spec/generic/api/owner/config.rb
cancan-permits-0.3.9 spec/generic/api/owner/config.rb
cancan-permits-0.3.8 spec/generic/api/owner/config.rb
cancan-permits-0.3.7 spec/generic/api/owner/config.rb
cancan-permits-0.3.6 spec/generic/api/owner/config.rb
cancan-permits-0.3.5 spec/generic/api/owner/config.rb
cancan-permits-0.3.4 spec/generic/api/owner/config.rb
cancan-permits-0.3.2 spec/generic/api/owner/config.rb
cancan-permits-0.3.1 spec/generic/api/owner/config.rb
cancan-permits-0.3.0 spec/generic/api/owner/config.rb
cancan-permits-0.2.9 spec/generic/api/owner/config.rb
cancan-permits-0.2.8 spec/generic/api/owner/config.rb
cancan-permits-0.2.7 spec/generic/api/owner/config.rb