Sha256: 31d5680e60e7dc61cd92f430dbaca3fdf12c2278d4c67bd05dc662dd6fb51b5f

Contents?: true

Size: 834 Bytes

Versions: 15

Compression:

Stored size: 834 Bytes

Contents

require 'generic/api/owner/xgroup'

def two_users_config 
  @editor         = User.create(:name => "Kristian", :role => "editor")
  @other_guy      = User.create(:name => "Random dude", :role => "admin")

  @ability        = Permits::Ability.new(@editor)

  @own_post       = Post.create(:writer => @editor.id)
  @other_post     = Post.create(:writer => @other_guy.id)      
end

def editor_config
  @editor         = User.create(:name => "Kristian", :role => "editor")
  @other_guy      = User.create(:name => "Random dude", :role => "admin")

  @ability        = Permits::Ability.new(@editor)

  @own_comment    = Comment.create(:user_id => @editor.id)
  @other_comment  = Comment.create(:user_id => @other_guy.id)      
  # @post     = Post.create(:writer => @editor.id)
  # @article  = Article.create(:author => @editor.id)
end  

Version data entries

15 entries across 15 versions & 1 rubygems

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