24 lines
587 B
Ruby
24 lines
587 B
Ruby
require 'spec_helper'
|
|
|
|
xdescribe TeacherDistribution do
|
|
|
|
let(:teacher) {FactoryBot.create(:teacher_user)}
|
|
|
|
|
|
describe "index" do
|
|
it "empty" do
|
|
TeacherDistribution.index(teacher, {})[:query].count.should eql 0
|
|
end
|
|
|
|
it "returns single" do
|
|
distribution = FactoryBot.create(:teacher_distribution, teacher: teacher)
|
|
|
|
TeacherDistribution.index(teacher, {})[:query].count.should eql 1
|
|
|
|
distribution = FactoryBot.create(:teacher_distribution) # some random teacher
|
|
|
|
TeacherDistribution.index(teacher, {})[:query].count.should eql 1
|
|
end
|
|
end
|
|
end
|