Skip to content
Extraits de code Groupes Projets
Valider d4bf2f53 rédigé par maxwell's avatar maxwell
Parcourir les fichiers

DG MS; removed signup link and route

parent 043924b5
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
class StatusMessagesController < ApplicationController
#before_filter :authenticate_user!
before_filter :authenticate_user!
include StatusMessagesHelper
def index
......
- if controller_name != 'sessions'
= link_to "Sign in", new_session_path(resource_name)
%br/
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to "Sign up", new_registration_path(resource_name)
%br/
/- if devise_mapping.registerable? && controller_name != 'registrations'
/= link_to "Sign up", new_registration_path(resource_name)
/%br/
- if devise_mapping.recoverable? && controller_name != 'passwords'
= link_to "Forgot your password?", new_password_path(resource_name)
%br/
......
......@@ -12,7 +12,7 @@ Diaspora::Application.routes.draw do |map|
devise_for :users, :path_names => {:sign_up => "signup", :sign_in => "login", :sign_out => "logout"}
match 'login', :to => 'devise/sessions#new', :as => "new_user_session"
match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session"
match 'signup', :to => 'devise/registrations#new', :as => "new_user_registration"
#match 'signup', :to => 'devise/registrations#new', :as => "new_user_registration"
match 'receive', :to => 'dashboard#receive'
......
......@@ -3,7 +3,7 @@ module Diaspora
module Webhooks
def self.included(klass)
klass.class_eval do
before_save :notify_friends
after_save :notify_friends
@@queue = MessageHandler.new
......
require File.dirname(__FILE__) + '/../spec_helper'
include Diaspora
describe Diaspora do
describe Webhooks do
before do
@user = Factory.create(:user)
@post = Factory.build(:post)
end
......@@ -30,11 +32,35 @@ describe Diaspora do
end
it "should send all prepped webhooks to be processed" do
MessageHandler.any_instance.stubs(:add_post_request).returns(true)
MessageHandler.any_instance.stubs(:process).returns(true)
MessageHandler.any_instance.stubs(:add_post_request).returns true
MessageHandler.any_instance.stubs(:process).returns true
@post.notify_friends.should be true
end
it "should check that it only sends a user's posts to their friends" do
Factory.create(:friend, :url => "http://www.bob.com")
Factory.create(:friend, :url => "http://www.alice.com")
Factory.create(:status_message)
Factory.create(:bookmark)
# this is a messagequeue thing; out of scope for webhooks action
end
it "should ensure no duplicate url posts" do
pending
# this is a messagequeue thing; out of scope for webhooks action
end
it "should build an xml object containing multiple Post types" do
Factory.create(:status_message)
Factory.create(:bookmark)
stream = Post.stream
xml = Post.build_xml_for(stream)
xml.should include "<status_message>"
xml.should include "<bookmark>"
end
end
end
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