Sha256: 5be2b2bb76017d2b614dc3cd395604abb229c10fb0f9eac9b8969c58bd9084c4

Contents?: true

Size: 1.51 KB

Versions: 8

Compression:

Stored size: 1.51 KB

Contents

require 'rails_helper'

RSpec.describe CoalescingPanda::Course, :type => :model do
  let(:course) { FactoryGirl.create(:course) }

  context "associations" do
    it 'should belong_to an account' do
      expect(CoalescingPanda::Course.reflect_on_association(:account)).to_not be_nil
      expect(CoalescingPanda::Course.reflect_on_association(:account).macro).to eql(:belongs_to)
    end

    it 'should belong_to a term' do
      expect(CoalescingPanda::Course.reflect_on_association(:term)).to_not be_nil
      expect(CoalescingPanda::Course.reflect_on_association(:term).macro).to eql(:belongs_to)
    end

    it 'should have many sections' do
      expect(CoalescingPanda::Course.reflect_on_association(:sections)).to_not be_nil
      expect(CoalescingPanda::Course.reflect_on_association(:sections).macro).to eql(:has_many)
    end

    it 'should have many assignments' do
      expect(CoalescingPanda::Course.reflect_on_association(:assignments)).to_not be_nil
      expect(CoalescingPanda::Course.reflect_on_association(:assignments).macro).to eql(:has_many)
    end

    it 'should have many enrollments' do
      expect(CoalescingPanda::Course.reflect_on_association(:enrollments)).to_not be_nil
      expect(CoalescingPanda::Course.reflect_on_association(:enrollments).macro).to eql(:has_many)
    end

    it 'should have many users' do
      expect(CoalescingPanda::Course.reflect_on_association(:users)).to_not be_nil
      expect(CoalescingPanda::Course.reflect_on_association(:users).macro).to eql(:has_many)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
coalescing_panda-3.1.5 spec/models/coalescing_panda/course_spec.rb
coalescing_panda-3.1.4 spec/models/coalescing_panda/course_spec.rb
coalescing_panda-3.1.3 spec/models/coalescing_panda/course_spec.rb
coalescing_panda-3.1.2 spec/models/coalescing_panda/course_spec.rb
coalescing_panda-3.1.1 spec/models/coalescing_panda/course_spec.rb
coalescing_panda-3.1.0 spec/models/coalescing_panda/course_spec.rb
coalescing_panda-3.0.1 spec/models/coalescing_panda/course_spec.rb
coalescing_panda-3.0.0 spec/models/coalescing_panda/course_spec.rb