Sha256: 776f11c4609fc81caac15eae638dea33cbceadc633e25bf2c56d44da8d6736ea
Contents?: true
Size: 1.06 KB
Versions: 11
Compression:
Stored size: 1.06 KB
Contents
require "spec_helper" module SocialNetworking describe Comment, type: :model do fixtures(:participants, :"social_networking/goals") let(:participant1) { participants(:participant1) } let(:goal) { social_networking_goals(:participant2_goal_alpha) } it "should return the number of comments made today" do expect do Comment.create( participant_id: participant1.id, item: goal, text: "love this test", created_at: Date.today ) end.to change { Comment.for_today.count }.by(1) end it "should return the number of comments made in the past seven days" do expect do Comment.create( participant_id: participant1.id, item: goal, text: "love this test", created_at: Date.today - 1.days ) Comment.create( participant_id: participant1.id, item: goal, text: "love this test", created_at: Date.today - 8.days ) end.to change { Comment.for_week.count }.by(1) end end end
Version data entries
11 entries across 11 versions & 1 rubygems