Sha256: 62159634849a0682f0dfc5bdea3cb9e83487526412b354c59053c667a7980a36

Contents?: true

Size: 1.19 KB

Versions: 22

Compression:

Stored size: 1.19 KB

Contents

shared_examples_for "Guest account" do
  it 'should allow :read of all Articles' do
    user_account.should be_allowed_to(:read, article)
  end

  it 'should allow :read of all Posts' do
    user_account.should be_allowed_to(:read, post)
  end

  it 'should allow :read of all Comments' do
    user_account.should be_allowed_to(:read, comment)
  end
end

shared_examples_for "User account" do
  it_should_behave_like "Guest role" do
  end

  it 'should allow :management of own Articles' do
    user_account.should be_allowed_to(:manage, own_article)
  end

  it 'should allow :management of own Posts' do
    user_account.should be_allowed_to(:manage, own_post)
  end

  it 'should allow :management of own Comments' do
    user_account.should be_allowed_to(:manage, own_comment)
  end
end

shared_examples_for "Admin account" do
  it_should_behave_like "User account" do
  end

  it 'should allow :management of all Articles' do
    user_account.should be_allowed_to(:manage, article)
  end

  it 'should allow :management of all Posts' do
    user_account.should be_allowed_to(:manage, post)
  end

  it 'should allow :management of all Comments' do
    user_account.should be_allowed_to(:manage, comment)
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
cantango-0.9.4.7 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.9.4.6 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.9.4.5 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.9.4.3 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.9.4.2 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.9.4.1 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.9.4 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.9.3.2 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.9.5 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.9.4 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.9.3 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.9.2 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.9.1 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.9 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.8.1 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.8 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.7 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.6.2 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.6.1 spec/active_record/scenarios/shared/examples/user_accounts.rb
cantango-0.8.6 spec/active_record/scenarios/shared/examples/user_accounts.rb