Skip to content
Extraits de code Groupes Projets
Valider 7b17b78d rédigé par Steffen van Bergerem's avatar Steffen van Bergerem
Parcourir les fichiers

Try to improve the notifications controller spec

parent 4f8cf0fe
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -131,25 +131,23 @@ describe NotificationsController, :type => :controller do ...@@ -131,25 +131,23 @@ describe NotificationsController, :type => :controller do
expect(Notification.where(:unread => true).count).to eq(1) expect(Notification.where(:unread => true).count).to eq(1)
end end
it "should redirect back in the html version if it has > 0 notifications" do it "should redirect back in the html version if it has > 0 notifications" do
FactoryGirl.create(:notification, :recipient => alice) FactoryGirl.create(:notification, :recipient => alice, :type => "Notifications::StartedSharing")
eve.share_with(alice.person, eve.aspects.first) get :read_all, :format => :html, "type" => "liked"
get :read_all, :format => :html, "type" => "started_sharing"
expect(response).to redirect_to(notifications_path) expect(response).to redirect_to(notifications_path)
end end
it "should redirect back in the mobile version if it has > 0 notifications" do it "should redirect back in the mobile version if it has > 0 notifications" do
FactoryGirl.create(:notification, :recipient => alice) FactoryGirl.create(:notification, :recipient => alice, :type => "Notifications::StartedSharing")
eve.share_with(alice.person, eve.aspects.first) get :read_all, :format => :mobile, "type" => "liked"
get :read_all, :format => :mobile, "type" => "started_sharing"
expect(response).to redirect_to(notifications_path) expect(response).to redirect_to(notifications_path)
end end
it "should redirect to stream in the html version if it has 0 notifications" do it "should redirect to stream in the html version if it has 0 notifications" do
FactoryGirl.create(:notification, :recipient => alice) FactoryGirl.create(:notification, :recipient => alice, :type => "Notifications::StartedSharing")
get :read_all, :format => :html get :read_all, :format => :html, "type" => "started_sharing"
expect(response).to redirect_to(stream_path) expect(response).to redirect_to(stream_path)
end end
it "should redirect back in the mobile version if it has 0 notifications" do it "should redirect back in the mobile version if it has 0 notifications" do
FactoryGirl.create(:notification, :recipient => alice) FactoryGirl.create(:notification, :recipient => alice, :type => "Notifications::StartedSharing")
get :read_all, :format => :mobile get :read_all, :format => :mobile, "type" => "started_sharing"
expect(response).to redirect_to(stream_path) expect(response).to redirect_to(stream_path)
end end
it "should return a dummy value in the json version" do it "should return a dummy value in the json version" do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter