Skip to content

Instantly share code, notes, and snippets.

@danlopez
Created March 24, 2014 18:59
Show Gist options
  • Save danlopez/9746771 to your computer and use it in GitHub Desktop.
Save danlopez/9746771 to your computer and use it in GitHub Desktop.
Testing count with random number of models
it "returns correct number of submissions" do
meet = FactoryGirl.create(:meet, :user_group => group)
num = rand(10) #random number of submissions from 0 to 10
num.times do
FactoryGirl.create(:meet_submission, :meet => meet)
end
result = group.get_submission_count
expect(result).to eq(num)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment