Sha256: c369ddbfaa715b7b69c04b9a160a286a3df6c41f459da32c99720a17cc904d8c

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

require 'rails_helper'

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

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

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

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

    it 'should have many submissions' do
      expect(CoalescingPanda::User.reflect_on_association(:submissions)).to_not be_nil
      expect(CoalescingPanda::User.reflect_on_association(:submissions).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/user_spec.rb
coalescing_panda-3.1.4 spec/models/coalescing_panda/user_spec.rb
coalescing_panda-3.1.3 spec/models/coalescing_panda/user_spec.rb
coalescing_panda-3.1.2 spec/models/coalescing_panda/user_spec.rb
coalescing_panda-3.1.1 spec/models/coalescing_panda/user_spec.rb
coalescing_panda-3.1.0 spec/models/coalescing_panda/user_spec.rb
coalescing_panda-3.0.1 spec/models/coalescing_panda/user_spec.rb
coalescing_panda-3.0.0 spec/models/coalescing_panda/user_spec.rb