Sha256: 909c3fd6dd5adeaea200c7954563f07c93dfb157428745654ed915b515701024

Contents?: true

Size: 877 Bytes

Versions: 5

Compression:

Stored size: 877 Bytes

Contents

require 'spec_helper_models'

describe Gaku::GradingMethod do

  describe 'relations' do
    it { should have_one :exam }
    it { should have_one :exam_portion }
    it { should have_one :assignment }

    it { should have_many :simple_grade_types }
    it { should have_many :grading_method_connectors }

    it { should have_many :grading_method_set_items }
    it { should have_many(:grading_method_sets).through(:grading_method_set_items) }
  end

  describe 'validations' do
    it { should validate_presence_of :name }
    it { should validate_uniqueness_of :name }
    it { should validate_presence_of :grading_type }
    it { should validate_inclusion_of(:grading_type).in_array(Gaku::GradingMethod::Types) }

  end

  describe '#to_s' do
    let(:grading_method) { build(:grading_method) }
    specify { grading_method.to_s.should eq grading_method.name }
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gaku-0.2.4 core/spec/models/grading_method_spec.rb
gaku-0.2.3 core/spec/models/grading_method_spec.rb
gaku-0.2.2 core/spec/models/grading_method_spec.rb
gaku-0.2.1 core/spec/models/grading_method_spec.rb
gaku-0.2.0 core/spec/models/grading_method_spec.rb