Sha256: b5bf9b820022005ee1aa4c4962be501ae5e0231109d3661db01e9e97d62e1309

Contents?: true

Size: 727 Bytes

Versions: 8

Compression:

Stored size: 727 Bytes

Contents

require 'spec_helper'

describe Ability do
  describe "as a course admin user" do
    subject { Ability.new(Factory.build(:user_course_admin), 'Admin') }
    
    it { should be_able_to(:manage, School) }
  end

  describe "as a learner user" do
    subject { Ability.new(Factory.build(:user_learner)) }

    it { should be_able_to(:create, School) }
    it { should be_able_to(:update, School) }
    it { should be_able_to(:index, School) }
  end

  describe "as an unregistered user" do
    subject { Ability.new(User.new) }
    
    it { should be_able_to(:create, School) }
    it { should be_able_to(:update, School) }
    it { should be_able_to(:index, School) }   
    it { should be_able_to(:create, User) }
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
scidea-schools-1.1 spec/models/ability_spec.rb
scidea-schools-1.0.6 spec/models/ability_spec.rb
scidea-schools-1.0.5 spec/models/ability_spec.rb
scidea-schools-1.0.4 spec/models/ability_spec.rb
scidea-schools-1.0.3 spec/models/ability_spec.rb
scidea-schools-1.0.2 spec/models/ability_spec.rb
scidea-schools-1.0.1 spec/models/ability_spec.rb
scidea-schools-1.0.0 spec/models/ability_spec.rb