From 63866a81287392f5b631b28e7508cb0742eb2ba3 Mon Sep 17 00:00:00 2001 From: maxwell <maxwell@joindiaspora.com> Date: Fri, 18 Jun 2010 23:47:42 -0700 Subject: [PATCH] playing --- Gemfile | 2 +- app/controllers/application_controller.rb | 2 +- app/controllers/dashboard_controller.rb | 5 ++ config/boot.rb | 1 + config/routes.rb | 68 ++--------------------- spec/helpers/parser_spec.rb | 14 +++++ 6 files changed, 26 insertions(+), 66 deletions(-) diff --git a/Gemfile b/Gemfile index 274a0b8f57..e704cef898 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem "bson_ext", "1.0.1" gem "haml" gem "devise", :git => "git://github.com/plataformatec/devise.git" gem 'roxml', :git => "git://github.com/Empact/roxml.git" - +gem 'em-websocket' gem 'dm-core' group :test do diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 42dd80cd40..876af6c653 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,5 +2,5 @@ class ApplicationController < ActionController::Base protect_from_forgery :except => :receive layout 'application' - + end diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 7196b7fb5d..689eae6e65 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -12,4 +12,9 @@ class DashboardController < ApplicationController store_posts_from_xml (params[:xml]) render :nothing => true end + + def socket + #this is just for me to test teh sockets! + render "socket" + end end diff --git a/config/boot.rb b/config/boot.rb index ab6cb374de..62548470c5 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -11,3 +11,4 @@ rescue Bundler::GemNotFound => e STDERR.puts "Try running `bundle install`." exit! end if File.exist?(gemfile) + diff --git a/config/routes.rb b/config/routes.rb index 7d6f2a0a0e..54f48a4ffb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,12 +1,10 @@ Diaspora::Application.routes.draw do |map| resources :blogs - resources :bookmarks - resources :friends - resources :status_messages - + resources :status_messages + #routes for devise, not really sure you will need to mess with this in the future, lets put default, #non mutable stuff in anohter file devise_for :users, :path_names => {:sign_up => "signup", :sign_in => "login", :sign_out => "logout"} @@ -14,68 +12,10 @@ Diaspora::Application.routes.draw do |map| match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" #match 'signup', :to => 'devise/registrations#new', :as => "new_user_registration" - match 'receive', :to => 'dashboard#receive' resources :users - resources :status_messages - - - # The priority is based upon order of creation: - # first created -> highest priority. - - # Sample of regular route: - # match 'products/:id' => 'catalog#view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase - # This route can be invoked with purchase_url(:id => product.id) - - # Sample resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Sample resource route with options: - # resources :products do - # member do - # get :short - # post :toggle - # end - # - # collection do - # get :sold - # end - # end - - # Sample resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Sample resource route with more complex sub-resources - # resources :products do - # resources :comments - # resources :sales do - # get :recent, :on => :collection - # end - # end - - # Sample resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end - - # You can have the root of your site routed with "root" - # just remember to delete public/index.html. - # root :to => "welcome#index" - - # See how all your routes lay out with "rake routes" - - # This is a legacy wild controller route that's not recommended for RESTful applications. - # Note: This route will make all actions in every controller accessible via GET requests. - # match ':controller(/:action(/:id(.:format)))' + match 'receive', :to => 'dashboard#receive' + match "socket", :to => 'dashboard#socket' root :to => 'dashboard#index' diff --git a/spec/helpers/parser_spec.rb b/spec/helpers/parser_spec.rb index 542a1aa0a1..5d742239f4 100644 --- a/spec/helpers/parser_spec.rb +++ b/spec/helpers/parser_spec.rb @@ -37,5 +37,19 @@ describe ApplicationHelper do Post.count.should == 2 end + + describe "parsing a sender" do + it 'should be able to parse the sender of a collection' do + status_messages = [] + 10.times { status_messages << Factory.build(:status_message)} + xml = Post.build_xml_for(status_messages) + end + + it 'should be able to verify the sender as a friend' do + pending + end + + end + end -- GitLab