speed up notifications controller index spec
This commit is contained in:
parent
b8ea8e9e75
commit
eaf7fcd7fe
1 changed files with 6 additions and 3 deletions
|
|
@ -47,15 +47,18 @@ describe NotificationsController do
|
|||
describe '#index' do
|
||||
before do
|
||||
@post = Factory(:status_message)
|
||||
26.times do
|
||||
Factory(:notification, :recipient => @user, :target => @post)
|
||||
end
|
||||
end
|
||||
|
||||
it 'paginates the notifications' do
|
||||
25.times do
|
||||
Factory(:notification, :recipient => @user, :target => @post)
|
||||
end
|
||||
|
||||
@controller.index({})[:notifications].count.should == 25
|
||||
@controller.index(:page => 2)[:notifications].count.should == 1
|
||||
end
|
||||
|
||||
it "includes the actors" do
|
||||
notification = Factory(:notification, :recipient => @user, :target => @post)
|
||||
response = @controller.index({})
|
||||
|
|
|
|||
Loading…
Reference in a new issue