Skip to content
Extraits de code Groupes Projets
Valider eaf7fcd7 rédigé par Dan Hansen's avatar Dan Hansen
Parcourir les fichiers

speed up notifications controller index spec

parent b8ea8e9e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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
Factory(:notification, :recipient => @user, :target => @post)
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({})
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter