diff --git a/.gitignore b/.gitignore index 1fbfd2e0431ec251a2e56b9bb876c7d83d7e7ff7..571cd38ae9a22fb86fc087d8f5f36566251e0415 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,21 @@ .bundle +.DS_Store .idea +.rvmrc *.swap -*.swp *.swo +*.swp *~ -.bundle +bin/* +config/app_config.yml +config/fb_config.yml +config/initializers/secret_token.rb db/*.sqlite3 log/* -tmp/**/* +nbproject gpg/diaspora-development/*.gpg gpg/diaspora-production/*.gpg gpg/*/random_seed public/uploads/* -.rvmrc -.DS_Store -config/app_config.yml -bin/* -nbproject -config/initializers/secret_token.rb public/source.tar -config/fb_config.yml +tmp/**/* diff --git a/README.md b/README.md index 57bb01c4e4aa330cbe728daad80375786e01a7ed..bac9cd40fcca0c05476a3a5f7a111ee9adfcfcf9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,10 @@ instructions. You are welcome to contribute, add to and extend Diaspora however you see fit. We will do our best to incorporate everything that meets our guidelines. -Please do not rebase our tree into yours. +Please make your changes on a topic branch in your repo and submit your pull request +from there, so that commits you don't want to submit aren't included. + +Please do not rebase our tree into yours. See [here](http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html) for when to rebase. @@ -56,7 +59,7 @@ Ongoing discussion: More general info and updates about the project can be found on: [Our blog](http://joindiaspora.com), [and on Twitter](http://twitter.com/joindiaspora). -Also, be sure to join the official [mailing list](http://http://eepurl.com/Vebk). +Also, be sure to join the official [mailing list](http://eepurl.com/Vebk). If you wish to contact us privately about any exploits in Diaspora you may find, you can email diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 3d750d41f20d6bfdc5afc0d8bb367d70c1083b40..81056ef10a1477cad00833e66270d3c7eb2d1d4a 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -32,8 +32,8 @@ class AspectsController < ApplicationController begin current_user.drop_aspect @aspect - flash[:notice] = i18n.t 'aspects.destroy.success',:name => @aspect.name - rescue RuntimeError => e + flash[:notice] = I18n.t 'aspects.destroy.success',:name => @aspect.name + rescue RuntimeError => e flash[:error] = e.message end @@ -56,7 +56,7 @@ class AspectsController < ApplicationController respond_with @aspect end - + def manage @aspect = :manage @remote_requests = Request.for_user(current_user).all @@ -67,7 +67,7 @@ class AspectsController < ApplicationController data = clean_hash(params[:aspect]) @aspect.update_attributes( data ) - flash[:notice] = i18n.t 'aspects.update.success',:name => @aspect.name + flash[:notice] = I18n.t 'aspects.update.success',:name => @aspect.name respond_with @aspect end @@ -75,13 +75,13 @@ class AspectsController < ApplicationController params[:moves].each{ |move| move = move[1] unless current_user.move_friend(move) - flash[:error] = i18n.t 'aspects.move_friends.failure', :real_name => Person.find_by_id( move[:friend_id] ).real_name + flash[:error] = I18n.t 'aspects.move_friends.failure', :real_name => Person.find_by_id( move[:friend_id] ).real_name redirect_to aspects_manage_path return end } - flash[:notice] = i18n.t 'aspects.move_friends.success' + flash[:notice] = I18n.t 'aspects.move_friends.success' redirect_to aspects_manage_path end diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 311fdf73f7b55f436f666ff6b82a4be2aba1a363..f57b945404dfa6d8f4ad2e616d6bfd71ec33fc24 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -30,7 +30,7 @@ class PublicsController < ApplicationController def hub if params['hub.mode'] == 'subscribe' || params['hub.mode'] == 'unsubscribe' - render :text => params['hub.challenge'], :status => 202, :layout => false + render :text => params['hub.challenge'], :status => 202, :layout => false end end diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index b072564bb9246f854a5c4e2fb44fc1f23025dcd5..137dd8a7eb5f302350f8fb3dc1d01fe5b5dadb40 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -12,18 +12,18 @@ class StatusMessagesController < ApplicationController params[:status_message][:to] = params[:aspect_ids] data = clean_hash params[:status_message] - + if @logged_in && params[:status_message][:public] == 'true' id = 'me' type = 'feed' - + Rails.logger.info("Sending a message: #{params[:status_message][:message]} to Facebook") @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>{:message => params[:status_message][:message]}) end @status_message = current_user.post(:status_message, data) - respond_with @status_message + render :nothing => true end def destroy diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ab8939b87d7f4e224fbf75586d7903e5795e5289..9b41b1fc9b215d11e9d8a566fd4e1abf8ce27b45 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -27,16 +27,16 @@ class UsersController < ApplicationController params[:user].delete(:password) if params[:user][:password].blank? params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank? - + if params[:user][:password] && params[:user][:password_confirmation] if @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation]) flash[:notice] = "Password Changed" else flash[:error] = "Password Change Failed" end - + end - + @user.update_profile data redirect_to edit_user_path(@user) diff --git a/app/models/fb_status.rb b/app/models/fb_status.rb index fd190c2c72f5b6274c16cb2d2c2a7378882d3869..40d9cb16e8060f9a23b8fb24370798b1340fe8d9 100644 --- a/app/models/fb_status.rb +++ b/app/models/fb_status.rb @@ -3,14 +3,14 @@ # the COPYRIGHT file. -class FbStatus +class FbStatus include MongoMapper::Document key :graph_id, String key :author_id, String key :author_name, String key :message, String - key :updated_time, Time + key :updated_time, Time timestamps! @@ -18,7 +18,7 @@ class FbStatus def self.from_api(hash) #just keeping them in memory for now - self.new( + self.new( :graph_id => hash['id'], :author_id => hash['from']['id'], :author_name => hash['from']['name'], @@ -26,6 +26,6 @@ class FbStatus :updated_time => Time.parse(hash['updated_time']) ) end - + end diff --git a/app/models/user.rb b/app/models/user.rb index 15c3515c2dd75b334ea580085958c5943a48da8a..238397bdcb3b16c255f97372daabd856cfebd350 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -254,7 +254,7 @@ class User def self.instantiate!( opts = {} ) opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}" opts[:person][:url] = APP_CONFIG[:pod_url] - + opts[:serialized_private_key] = generate_key opts[:person][:serialized_public_key] = opts[:serialized_private_key].public_key User.create(opts) @@ -288,7 +288,7 @@ class User def self.generate_key OpenSSL::PKey::RSA::generate 4096 end - + def encryption_key OpenSSL::PKey::RSA.new( serialized_private_key ) end diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index f04b63489e8172cb6091767b058edf2b28849208..e85cae2762d866c1ee5b4ceb91128f109e80eb7e 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -12,7 +12,7 @@ - content_for :publish do - if @logged_in = render "shared/publisher", :aspect_ids => :public - - else + - else = render "shared/publisher", :aspect_ids => :all %ul#stream diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index e24dc5537082f566498eac870e299c92e23ab26d..8c22700aad139e6d4a68221429534d05ea569e38 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -8,8 +8,8 @@ = person_image_link(friend) - if @logged_in && (@aspect == :public) %h3 Facebook Friends - - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - - @fb_friends[:data].each do |friend| + - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") + - @fb_friends[:data].each do |friend| = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) -unless (@aspect == :all) || (@aspect == :public) = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' diff --git a/app/views/users/_services.haml b/app/views/users/_services.haml index fd1894d117d622a3f05dc16f167f222c2feb667a..648fbe1612b76b1673806bad5b43eee14288da55 100644 --- a/app/views/users/_services.haml +++ b/app/views/users/_services.haml @@ -10,7 +10,7 @@ %p - if @logged_in = connected_fb_as(@access_token) - + %p - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - @fb_friends[:data].each do |friend| diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index a3f090027880c82dde29aded7294134600b7bc21..81fc639e72e6ff0b8c3f5ae00269518cf2110d62 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -26,5 +26,5 @@ #services.settings_pane = render 'users/services' - + diff --git a/config/deploy.rb b/config/deploy.rb index 66c642885a4f4b2d3f4777636dd1e8aeb1cdc8ef..a4f139b9c62d67afe6fb9a33f0ff5ea6e3fbd966 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -142,7 +142,7 @@ namespace :db do end task :backer_seed, :roles => :backer do - (0..10).each { |n| + (0..2).each { |n| run "curl -silent http://localhost/set_backer_number?number=#{n}", :only => {:number => n} } run "cd #{current_path} && bundle exec rake db:seed:backer --trace RAILS_ENV=#{rails_env}" diff --git a/config/deploy_config.yml b/config/deploy_config.yml index c7477314a2b359c2e9b6b15dafbda3602d4a8eed..55aa00f6ef63c7d5a3c4bccb1dd4a5c902c663f5 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -15,15 +15,15 @@ servers: - username: 'jackson' given_name: 'Andrew' family_name: 'Jackson' - number: 6 + number: 0 pin: 8670 - username: 'tyler' given_name: 'John' family_name: 'Tyler' - number: 9 + number: 1 pin: 6431 - username: 'polk' given_name: 'James K.' family_name: 'Polk' - number: 10 + number: 2 pin: 1957 diff --git a/config/initializers/_mongo.rb b/config/initializers/_mongo.rb index 8948a0c5979ffa311a066d37680d0c107e21f0d8..7d14315a70cd6fb8310a98a200061fbc0766ecbb 100644 --- a/config/initializers/_mongo.rb +++ b/config/initializers/_mongo.rb @@ -2,13 +2,10 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -if ENV['MONGOHQ_URL'] - MongoMapper.config = {RAILS_ENV => {'uri' => ENV['MONGOHQ_URL']}} -else - MongoMapper.connection = Mongo::Connection.new(APP_CONFIG['mongo_host'], APP_CONFIG['mongo_port']) -end +ENV['MONGODB_URL'] = ENV['MONGOHQ_URL'] || URI::Generic.build(:scheme => 'mongodb', :host => APP_CONFIG['mongo_host'], :port => APP_CONFIG['mongo_port'], :path => "/diaspora-#{Rails.env}").to_s -MongoMapper.database = "diaspora-#{Rails.env}" +MongoMapper.config = {RAILS_ENV => {'uri' => ENV['MONGODB_URL']}} +MongoMapper.connect RAILS_ENV if defined?(PhusionPassenger) PhusionPassenger.on_event(:starting_worker_process) do |forked| @@ -16,4 +13,4 @@ if defined?(PhusionPassenger) end end -Magent.connection = Mongo::Connection.new(APP_CONFIG['mongo_host'], APP_CONFIG['mongo_port']) +Magent.connection = MongoMapper.connection diff --git a/config/locales/devise/devise.ar.yml b/config/locales/devise/devise.ar.yml new file mode 100644 index 0000000000000000000000000000000000000000..2b555cb5f8a73de957eeb1b6711f8368e86595ae --- /dev/null +++ b/config/locales/devise/devise.ar.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +ar: + errors: + messages: + not_found: "لم يتم العثور على" + already_confirmed: "وقد أكد بالفعل" + not_locked: "لم يكن مغلق" + + devise: + failure: + unauthenticated: ".تحتاج إلى تسجيل الدخول أو قم بالتسجيل قبل الشروع في الاستمرار" + unconfirmed: ".لديك لتأكيد الحساب الخاص بك قبل المتابعة" + locked: ".مؤمن حسابك" + invalid: ".بريد إلكتروني غير صالح أو كلمة المرور" + invalid_token: ".المصادقة غير صالح الرمز المميز" + timeout: ".انتهت الدورة الخاصة بك ، الرجاء تسجيل الدخول مرة أخرى للمتابعة" + inactive: ".ولم يتم تفعيل حسابك بعد" + sessions: + signed_in: ".وقعت في بنجاح" + signed_out: ".بتسجيل الخروج بنجاح" + passwords: + send_instructions: ".سوف تتلقى رسالة بريد إلكتروني مع تعليمات حول كيفية إعادة تعيين كلمة السر الخاصة بك في بضع دقائق" + updated: ".تم تغيير كلمة السر الخاصة بك بنجاح. وقعت الآن دخولك" + confirmations: + send_instructions: ".سوف تتلقى رسالة بريد إلكتروني مع تعليمات حول كيفية تأكيد الحساب الخاص بك في بضع دقائق" + confirmed: ".وأكد حسابك بنجاح. وقعت الآن دخولك" + registrations: + signed_up: ".لقد قمت بتسجيل بنجاح. إذا مكن، وجهت رسالة تأكيد إلى البريد الإلكتروني الخاص بك" + updated: ".قمت بتحديث حسابك بنجاح" + destroyed: ".وداعا! تم إلغاء حسابك بنجاح. ونأمل أن نراكم مرة أخرى قريبا" + unlocks: + send_instructions: ".سوف تتلقى رسالة بريد إلكتروني مع تعليمات حول كيفية فتح حساب في بضع دقائق" + unlocked: ".كان حسابك مقفلة بنجاح. وقعت الآن دخولك" + mailer: + confirmation_instructions: "تأكيد تعليمات" + reset_password_instructions: "تعليمات إعادة تعيين كلمة المرور" + unlock_instructions: "فتح التعليمات" diff --git a/config/locales/devise/devise.nb.yml b/config/locales/devise/devise.nb.yml new file mode 100644 index 0000000000000000000000000000000000000000..d1e8ca2f75661142dade03288a44e993fad64b9b --- /dev/null +++ b/config/locales/devise/devise.nb.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +no_NO: + errors: + messages: + not_found: "ble ikke funnet" + already_confirmed: "er allerede bekrefta" + not_locked: "er ikke låst" + + devise: + failure: + unauthenticated: "Du må logge inn eller lage en bruker før du kan fortsette." + unconfirmed: "Du må bekrefte brukeren din før du kan fortsette." + locked: "Brukeren din er låst." + invalid: "Ugyldig e-postadresse eller passord." + invalid_token: "Ugyldig authentication token." + timeout: "Økta har løpt ut, logg inn igjen for å fortsette." + inactive: "Brukeren din er ikke aktivert ennå." + sessions: + signed_in: "Innlogginga var vellykka." + signed_out: "Utlogginga var vellykka." + passwords: + send_instructions: "Du vil få en e-post med instrukser om hvordan du tilbakestiller passordet ditt om kort tid." + updated: "Passordet ditt er nå endra, og du har logga inn." + confirmations: + send_instructions: "Du vil få en e-post med instrukser om hvordan du bekrefter brukeren din om kort tid." + confirmed: "Brukeren din er nå bekrefta, og du er logga inn." + registrations: + signed_up: "Du har nå laga en bruker. Hvis du valgte å få en e-post med bekreftelse på dette, er den nå sendt." + updated: "Du har oppdatert brukeren din." + destroyed: "Ha det! Brukeren din er nå sagt opp. Vi håper å se deg igjen snart." + unlocks: + send_instructions: "Du vil få en e-post med instrukser om hvordan du låser opp brukeren din om kort tid." + unlocked: "Brukeren din er nå låst opp, og du er logga in." + mailer: + confirmation_instructions: "Instrukser for bekreftelse" + reset_password_instructions: "Instrukser for tilbakestilling av passord" + unlock_instructions: "Instrukser for å låse opp" diff --git a/config/locales/diaspora/ar.yml b/config/locales/diaspora/ar.yml new file mode 100644 index 0000000000000000000000000000000000000000..cddf877063dd13351e56ea6da52a526830917f1e --- /dev/null +++ b/config/locales/diaspora/ar.yml @@ -0,0 +1,206 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +# Sample localization file for Arabic. + +ar: + hello: "مرحبا العالم" + application: + helper: + unknown_person: "غير معروف شخص" + new_requests: "طلبات جديدة" + dashboards: + helper: + home: "منزل" + error_messages: + helper: + invalid_fields: "الحقول غير صالحة" + correct_the_following_errors_and_try_again: ".تصحيح الأخطاء التالية وحاول مرة أخرى" + people: + helper: + results_for: "%{params} نتائج " + people_on_pod_are_aware_of: "الناس في جراب على علم " + layouts: + application: + edit_profile: "تعديل الملف الشخصي" + logout: "خروج" + shared: + aspect_nav: + all_aspects: "جميع الجوانب" + manage: "نجح" + manage_your_aspects: "إدارة جوانب الخاص" + sub_header: + all_aspects: "جميع الجوانب" + manage_aspects: "إدارة الجوانب" + publisher: + share: "تقاسم" + aspect_friends: + add_friends: "أضف أصدقاء" + albums: + album: + you: "أنت" + new_album: + create: "خلق" + add_a_new_album: "إضافة ألبوم جديد" + show: + edit_album: "تعديل الألبوم" + albums: "البومات" + updated: "تحديث" + by: "بواسطة" + edit: + editing: "التحرير" + updated: "تحديث" + are_you_sure: "هل أنت متأكد؟" + delete_album: "حذف ألبوم" + cancel: "إلغاء" + index: + home: "منزل" + new_album: "ألبوم جديد" + create: + success: ".ألبوما %{name} لقد قمت دعا" + update: + success: ".تحرير بنجاح %{name} الألبوم" + failure: ".%{name} فشلت في تحرير ألبوم" + destroy: + success: ".حذفها %{name} الألبوم" + helper: + friends_albums: "أصدقاء البومات" + your_albums: "البومات الخاص" + aspects: + index: + photos: "صور" + show: + photos: "صور" + manage: + add_a_new_aspect: "أضف جانبا جديدا" + add_a_new_friend: "إضافة صديق جديد" + show: "عرض" + update_aspects: "تحديث الجوانب" + requests: "طلبات" + ignore_remove: "تجاهل/إزالة" + new_aspect: + add_a_new_aspect: "أضف جانبا جديدا" + create: "خلق" + create: + success: ".الذي يمكن أن نرى الجانب الجديد الخاص بك Diaspora انقر على علامة الجمع على الجانب الأيسر لنقو" + failure: ".فشل إنشاء الجانب" + destroy: + success: ".%{name} وقد نجحت في إزالة" + update: + success: ".تحرير بنجاح ,%{name} ,وقد الجانب الخاص بك" + move_friends: + failure: ".%{real_name} فشل تحرير آسبكت لصدي" + success: ".جوانب الموضوع بنجاح" + move_friend: + failure: "%{inspect} لم تنجح" + success: ".أنت الآن عرض صديقك جانبا مختلفا من جوانب نفسك" + helper: + remove: "نزع" + aspect_not_empty: "الجانب يست فارغ" + users: + edit: + editing_profile: "تحرير الملف الشخصي" + profile: + cancel: "إلغاء" + update_profile: "تحديث الملف الشخصي" + home: "منزل" + diaspora_username: "اسم المستخدم DIASPORA" + info: "معلومات" + picture: "صورة" + editing_profile: "تحرير الملف الشخصي" + albums: "البومات" + you_dont_have_any_photos: "ليس لديك أي صوا! نتقل إلى" + page_to_upload_some: ".الصفحة لتحميل بعض" + comments: + comment: + ago: "منذ" + new_comment: + comment: "كيف" + photos: + show: + prev: "السابق" + full_size: "الحجم الكام" + next: "القادم" + edit_photo: "تحرير الصو" + delete_photo: "حذف الصو" + are_you_sure: "هل أنت متأكد؟" + comments: "تعليقات" + edit: + editing: "تصحيح" + are_you_sure: "هل أنت متأك؟" + delete_photo: "حذف الصو" + photo: + show_comments: "sعرض التعليقا" + posted_a_new_photo_to: "أرسلت صورة جديدة ل" + new: + new_photo: "جديد الصو" + back_to_list: "عودة إلى قائم" + post_it: "!بعد ذلك" + create: + runtime_error: "?فشل تحميل الصور. هل أنت متأكد من أن يتم ربط حزام الأمان" + integrity_error: "?فشل تحميل الصور. هل أنت متأكد من أن صورة" + type_error: "?فشل تحميل الصور. هل أنت متأكد من وأضيف صورة" + update: + notice: ".الصورة تحديثها بنجاح" + error: ".فشل لتحرير الصو" + destroy: + notice: ".الصور المحذوفة" + registrations: + new: + sign_up: "قم بالتسجي" + create: + success: "!Diaspora لقد انضممت" + status_messages: + new_status_message: + tell_me_something_good: "قل لي شيئا جيد" + oh_yeah: "!نعم" + status_message: + show_comments: "عرض التعليقا" + delete: "حذف" + are_you_sure: "هل أنت متأكد؟" + show: + status_message: "رسالة الحالة" + comments: "تعليقات" + are_you_sure: "هل أنت متأكد؟" + destroy: "هدم" + view_all: "عرض الك" + message: "رسالة" + owner: "مالك" + helper: + no_message_to_display: ".أي رسالة لعرضه" + people: + person: + add_friend: "أضف صدي" + pending_request: "في انتظار طلب" + index: + add_friend: "أضف صدي" + real_name: "اسمه الحقيقي" + diaspora_handle: "اسمك المستعار diaspora" + thats_you: "!هذا لك" + friend_request_pending: "طلب صديق معلقة" + you_have_a_friend_request_from_this_person: "لديك صديق طلب من هذا الشخص" + new: + new_person: "شخص جديد" + back_to_list: "عودة إلى قائمة" + show: + last_seen: "%{how_long_ago} :المشاهدة الأخيرة" + friends_since: "%{how_long_ago} :أصدقاء منذ" + save: "حفظ" + are_you_sure: "هل أنت متأكد؟" + remove_friend: "إزالة صديق" + requests: + new_request: + add_a_new_friend_to: "إضافة صديق جديد إلى" + enter_a_diaspora_username: ":Diaspora أدخل اسم مستخدم" + your_diaspora_username_is: "%{diaspora_handle} :هو Diaspora اسم المستخدم الخاص" + friends_username: "صديق اسم المستخدم" + destroy: + success: ".أنت الآن أصدقاء" + error: "!الرجاء اختيار جانبا" + ignore: ".صديق تجاهل الطلب" + create: + error: "!مع هذا البريد الإلكتروني diaspora لم يتم العثور على بذور" + already_friends: "!%{destination_url} كنت بالفعل مع أصدقاء" + success: ".%{destination_url} وأرسل طلب صداقة إلى" + horribly_wrong: ".ذهب شيء خاطئ" diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 898428db2d55b44ef8a8639ebbb06bcf86220023..7b454f8133ecdb10a58bfe6f213fc18aad0a7941 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -57,7 +57,7 @@ cs: new_album: create: "vytvořit" add_a_new_album: "Přidat nové album" - show: + show: edit_album: "Upravit album" albums: "alba" updated: "aktualizované" diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 1105a3bcb0253785b765c402f5c173d46c04a667..221a7c5f7c0bd5133461f95d8de7fa1cee8be6a7 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -46,7 +46,7 @@ he: new_album: create: "יצירה" add_a_new_album: "הוספת אלבום חדש" - show: + show: edit_album: "עריכת אלבום" albums: "אלבומים" updated: "תאריך העדכון" diff --git a/config/locales/diaspora/nb.yml b/config/locales/diaspora/nb.yml new file mode 100644 index 0000000000000000000000000000000000000000..6e2dc0ad3f2c810edc779eceaa6109f77f4a55a7 --- /dev/null +++ b/config/locales/diaspora/nb.yml @@ -0,0 +1,207 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Hallo, verden!" + application: + helper: + unknown_person: "ukjent person" + new_requests: "nye forespørsler" + dashboards: + helper: + home: "hjem" + error_messages: + helper: + invalid_fields: "Ugyldige felter" + correct_the_following_errors_and_try_again: "Rett opp de følgende feilene og prøv igjen." + people: + helper: + results_for: " resultater for %{params}" + people_on_pod_are_aware_of: " folk i belgen er oppmerksomme på" + layouts: + application: + edit_profile: "endre profil" + logout: "logg ut" + shared: + aspect_nav: + all_aspects: "Alle aspekter" + manage: "Organisere" + manage_your_aspects: "Organiser aspektene dine" + sub_header: + all_aspects: "Alle aspekter" + manage_aspects: "Organiser aspekter" + publisher: + share: "Del" + aspect_friends: + add_friends: "legg til venner" + albums: + album: + you: "deg" + new_album: + create: "Opprett" + add_a_new_album: "Legg til et nytt album" + show: + edit_album: "Endre album" + albums: "album" + updated: "oppdatert" + by: "av" + edit: + editing: "Redigerer" + updated: "oppdatert" + are_you_sure: "Er du sikker?" + delete_album: "Slett album" + cancel: "Avbryt" + index: + home: "hjem" + new_album: "Nytt album" + create: + success: "Du har oppretta albumet %{name}." + update: + success: "Albumet %{name} er endra." + failure: "Greide ikke å endre albumet %{name}." + destroy: + success: "Albumet %{name} er sletta." + helper: + friends_albums: "Venners album" + your_albums: "Dine album" + aspects: + index: + photos: "bilder" + show: + photos: "bilder" + manage: + add_a_new_aspect: "Legg til et nytt aspekt" + add_a_new_friend: "Legg til en ny venn" + show: "Vis" + update_aspects: "Oppdater aspekter" + requests: "Forespørsler" + ignore_remove: "Ignorer/fjern" + new_aspect: + add_a_new_aspect: "Legg til et nytt aspekt" + create: "Opprett" + create: + success: "Klikk på plusstegnet på venstre side for å fortelle Diaspora hvem som kan se det nye aspektet ditt." + failure: "Greide ikke å opprette aspektet." + destroy: + success: "%{name} har blitt fjerna." + update: + success: "Aspektet ditt, %{name}, har blitt endra." + move_friends: + failure: "Greide ikke å endre aspektet for vennen %{real_name}." + success: "Aspektene har blitt endra." + move_friend: + failure: "virka ikke %{inspect}" + success: "Vennen din ser nå et annet aspekt av deg." + helper: + remove: "fjern" + aspect_not_empty: "Aspektet er ikke tomt" + users: + edit: + editing_profile: "Redigerer profil" + profile: + cancel: "Avbryt" + update_profile: "Oppdater profil" + home: "Hjem" + diaspora_username: "DIASPORA-BRUKERNAVN" + info: "Informasjon" + picture: "Bilde" + editing_profile: "Redigerer profil" + albums: "Album" + you_dont_have_any_photos: "Du har ikke noen bilder! Gå til" + page_to_upload_some: "for å laste opp noen." + comments: + comment: + ago: "sia" + new_comment: + comment: "Kommenter" + photos: + show: + prev: "forrige" + full_size: "full størrelse" + next: "neste" + edit_photo: "Rediger bilde" + delete_photo: "Slett bilde" + are_you_sure: "Er du sikker?" + comments: "kommentarer" + edit: + editing: "Redigerer" + are_you_sure: "Er du sikker?" + delete_photo: "Slett bilde" + photo: + show_comments: "vis kommentarer" + posted_a_new_photo_to: "la til ett nytt bilde i" + new: + new_photo: "Nytt bilde" + back_to_list: "Tilbake til lista" + post_it: "legg ut!" + create: + runtime_error: "Greide ikke å laste opp bildet. Er du sikker på at setebeltet er festa?" + integrity_error: "Greide ikke å laste opp bildet. Er du sikker på at det var et bilde?" + type_error: "Greide ikke å laste opp bildet. Er du sikker på at et bilde ble lagt til?" + update: + notice: "Bildet er oppdatert." + error: "Greide ikke å endre bildet." + destroy: + notice: "Bildet er sletta." + registrations: + new: + sign_up: "Registrer deg" + create: + success: "Du er nå med i Diaspora!" + status_messages: + new_status_message: + tell_me_something_good: "Fortell noe tøft" + oh_yeah: "Ja da!" + status_message: + show_comments: "vis kommentarer" + delete: "Slett" + are_you_sure: "Er du sikker?" + show: + status_message: "Statusmelding" + comments: "kommentarer" + are_you_sure: "Er du sikker?" + destroy: "Utslett" + view_all: "Vis alle" + message: "Melding" + owner: "Eier" + helper: + no_message_to_display: "Ingen melding å vise." + people: + person: + add_friend: "legg til venn" + pending_request: "venter på svar" + index: + add_friend: "legg til venn" + real_name: "ekte navn" + diaspora_handle: "diaspora-bruker" + thats_you: "det er deg!" + friend_request_pending: "ubesvart venneforespørsel" + you_have_a_friend_request_from_this_person: "du har en venneforespørsel fra denne personen" + new: + new_person: "Ny person" + back_to_list: "Tilbake til lista" + show: + last_seen: "sist sett: %{how_long_ago}" + friends_since: "venner sia: %{how_long_ago}" + save: "lagre" + are_you_sure: "Er du sikker?" + remove_friend: "fjern venn" + requests: + new_request: + add_a_new_friend_to: "Legg til en ny venn i" + enter_a_diaspora_username: "Skriv en Diaspora-bruker:" + your_diaspora_username_is: "Din Diaspora-bruker er: %{diaspora_handle}" + friends_username: "Brukeren til vennen" + destroy: + success: "Dere er nå venner." + error: "Velg et aspekt først!" + ignore: "Ignorerte venneforespørsel" + create: + error: "Fant ingen diasporabruker med denne e-posten!" + already_friends: "Du er allerede venn med %{destination_url}!" + success: "Du sendte en venneforespørsel til %{destination_url}." + horribly_wrong: "Noe gikk forferdelig galt." diff --git a/config/routes.rb b/config/routes.rb index 2827c4cc771f3127e89495b2f9dc6d1b6c8397de..12fae72e6c4af839372002e29e02d0b476a08680 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,7 +9,7 @@ Diaspora::Application.routes.draw do resources :requests, :except => [:edit, :update] resources :photos, :except => [:index] resources :albums - + # added public route to user match 'public/:username', :to => 'users#public' resources :users, :except => [:create, :new, :show] diff --git a/config/sprinkle/provision.rb b/config/sprinkle/provision.rb index 3e30c26f4fc3998cde69bd06c835d01ba190f636..c3a7acae839bd40c4384ffadd370f8e8fe1dbf19 100644 --- a/config/sprinkle/provision.rb +++ b/config/sprinkle/provision.rb @@ -1,4 +1,4 @@ -#!/usr/bin/env sprinkle -s +# # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 0f0af8aa21238dba5a61badfccc3a32a209c4e1e..5a55297041acc5a7de5ed5f54ca4f92c19ebae66 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -1,6 +1,6 @@ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. @@ -191,7 +191,7 @@ Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do | end end end - + Then /^(?:|I )should be on (.+)$/ do |page_name| current_path = URI.parse(current_url).path if current_path.respond_to? :should @@ -205,8 +205,8 @@ Then /^(?:|I )should have the following query string:$/ do |expected_pairs| query = URI.parse(current_url).query actual_params = query ? CGI.parse(query) : {} expected_params = {} - expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} - + expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} + if actual_params.respond_to? :should actual_params.should == expected_params else diff --git a/features/support/env.rb b/features/support/env.rb index bcb1fdd000b72b839bff6e36da212663e13cf00d..2fb86c4dc89df0d4d65ffbf33cb2107bff557c9c 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,6 +1,6 @@ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. @@ -24,7 +24,7 @@ Capybara.default_selector = :css WebMock.disable_net_connect!(:allow_localhost => true) -# If you set this to false, any error raised from within your app will bubble +# If you set this to false, any error raised from within your app will bubble # up to your step definition and out to cucumber unless you catch it somewhere # on the way. You can make Rails rescue errors and render error pages on a # per-scenario basis by tagging a scenario or feature with the @allow-rescue tag. diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index 92e12122a522cacb38c4d74a9a8cdb0000d19211..48db7fd86f9a27c5dbf587e4b02966be3b490248 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -62,9 +62,9 @@ module Diaspora @user.visible_posts(:person_id => @user.person.id, :public=>true).inject("") do |xml,curr| if curr.respond_to?(:to_activity) unless xml - curr.to_activity + curr.to_activity else - xml + curr.to_activity + xml + curr.to_activity end end end diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index 36850c745473a41750c3f5ce00988edf8a164c08..61f86a19be2c9fbe20174840b93c96dba9bc3e4e 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -38,7 +38,8 @@ module Diaspora end def dispatch_friend_acceptance(request, requester) - salmon request, :to => requester + friend_acceptance = salmon(request) + push_to_person requester, friend_acceptance.xml_for(requester) request.destroy unless request.callback_url.include? url end diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 4258a8d88406289bd4c4baaadfcc718ed14fb056..e7690a578c2a7f8f63ab9b8cb23300c38c684367 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -53,7 +53,7 @@ module Salmon salmon.magic_sig = MagicSigEnvelope.create(user , user.person.aes_encrypt(activity, aes_key_hash)) salmon end - + def self.parse(xml, user) slap = self.new doc = Nokogiri::XML(xml) @@ -63,6 +63,7 @@ module Salmon ### Header ## decrypted_header = user.decrypt(doc.search('encrypted_header').text) header_doc = Nokogiri::XML(decrypted_header) + slap.author_email= header_doc.search('uri').text.split("acct:").last slap.aes_key = header_doc.search('aes_key').text slap.iv = header_doc.search('iv').text @@ -81,8 +82,6 @@ module Salmon raise ArgumentError, "Magic Signature data must be signed with RSA-SHA256, was #{slap.magic_sig.alg}" unless 'RSA-SHA256' == slap.magic_sig.alg - uri = doc.search('uri').text - slap.author_email = uri.split("acct:").last slap end @@ -91,10 +90,6 @@ module Salmon <?xml version='1.0' encoding='UTF-8'?> <entry xmlns='http://www.w3.org/2005/Atom'> <encrypted_header>#{person.encrypt(decrypted_header)}</encrypted_header> - <author> - <name>#{@author.real_name}</name> - <uri>acct:#{@author.diaspora_handle}</uri> - </author> #{@magic_sig.to_xml} </entry> ENTRY diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake index 15d405ad4c1ff74a4982eab90ea06326006724c9..055af1c6cc9d4acd69e8d9601f6d6eb4fe19b058 100644 --- a/lib/tasks/cucumber.rake +++ b/lib/tasks/cucumber.rake @@ -1,6 +1,6 @@ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. -# It is recommended to regenerate this file in the future when you upgrade to a -# newer version of cucumber-rails. Consider adding your own code to a new file +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. diff --git a/public/javascripts/fancybox/blank.gif b/public/javascripts/fancybox/blank.gif old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_close.png b/public/javascripts/fancybox/fancy_close.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_loading.png b/public/javascripts/fancybox/fancy_loading.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_nav_left.png b/public/javascripts/fancybox/fancy_nav_left.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_nav_right.png b/public/javascripts/fancybox/fancy_nav_right.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_e.png b/public/javascripts/fancybox/fancy_shadow_e.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_n.png b/public/javascripts/fancybox/fancy_shadow_n.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_ne.png b/public/javascripts/fancybox/fancy_shadow_ne.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_nw.png b/public/javascripts/fancybox/fancy_shadow_nw.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_s.png b/public/javascripts/fancybox/fancy_shadow_s.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_se.png b/public/javascripts/fancybox/fancy_shadow_se.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_sw.png b/public/javascripts/fancybox/fancy_shadow_sw.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_shadow_w.png b/public/javascripts/fancybox/fancy_shadow_w.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_title_left.png b/public/javascripts/fancybox/fancy_title_left.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_title_main.png b/public/javascripts/fancybox/fancy_title_main.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_title_over.png b/public/javascripts/fancybox/fancy_title_over.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancy_title_right.png b/public/javascripts/fancybox/fancy_title_right.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancybox-x.png b/public/javascripts/fancybox/fancybox-x.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancybox-y.png b/public/javascripts/fancybox/fancybox-y.png old mode 100755 new mode 100644 diff --git a/public/javascripts/fancybox/fancybox.png b/public/javascripts/fancybox/fancybox.png old mode 100755 new mode 100644 diff --git a/public/javascripts/jquery.cycle/src/jquery.cycle.lite.js b/public/javascripts/jquery.cycle/src/jquery.cycle.lite.js old mode 100755 new mode 100644 diff --git a/public/stylesheets/blueprint/plugins/buttons/icons/cross.png b/public/stylesheets/blueprint/plugins/buttons/icons/cross.png old mode 100755 new mode 100644 diff --git a/public/stylesheets/blueprint/plugins/buttons/icons/key.png b/public/stylesheets/blueprint/plugins/buttons/icons/key.png old mode 100755 new mode 100644 diff --git a/public/stylesheets/blueprint/plugins/buttons/icons/tick.png b/public/stylesheets/blueprint/plugins/buttons/icons/tick.png old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.eot b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.eot old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.ttf b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.ttf old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.woff b/public/stylesheets/brandongrotesque_light/Brandon_light-webfont.woff old mode 100755 new mode 100644 diff --git a/public/stylesheets/brandongrotesque_light/Extras/alt_base64_stylesheet.css b/public/stylesheets/brandongrotesque_light/Extras/alt_base64_stylesheet.css old mode 100755 new mode 100644 diff --git a/public/stylesheets/loading.gif b/public/stylesheets/loading.gif old mode 100755 new mode 100644 diff --git a/script/ubuntu-setup.bash b/script/ubuntu-setup.bash index c335fcf65aa705ec58cfcc1df30493a3127b5fb5..666eac818c9039a5cd1c3fe66a9e43d4f1973c84 100755 --- a/script/ubuntu-setup.bash +++ b/script/ubuntu-setup.bash @@ -11,7 +11,7 @@ # USAGE: ./script/ubuntu-setup.bash # Do NOT run this script as root. -# Set extented globbing +# Set extented globbing shopt -s extglob # fail on error @@ -23,29 +23,29 @@ We need to do some actions as an ordinary user. We use sudo where necessary." && # Check if the user has sudo privileges. sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } -# Check if universal repository is enabled +# Check if universal repository is enabled grep -i universe /etc/apt/sources.list > /dev/null || \ { echo "Please enable universe repository" ; exit 1 ; } # Make sure that we only install the latest version of packages sudo apt-get update -# Check if wget is installed +# Check if wget is installed test wget || { echo "Installing wget.." && sudo apt-get install wget \ && echo "Installed wget.." ; } -# Install build tools +# Install build tools echo "Installing build tools.." sudo apt-get -y --no-install-recommends install \ build-essential libxslt1.1 libxslt1-dev libxml2 echo "..Done installing build tools" -# Install Ruby 1.8.7 -echo "Installing ruby-full Ruby 1.8.7.." +# Install Ruby 1.8.7 +echo "Installing ruby-full Ruby 1.8.7.." sudo apt-get -y --no-install-recommends install ruby-full echo "..Done installing Ruby" -# Install Rake +# Install Rake echo "Installing rake.." sudo apt-get -y --no-install-recommends install rake echo "..Done installing rake" @@ -121,8 +121,8 @@ echo "Fetching and installing ruby gems.." echo "." sudo ln -s /usr/bin/gem1.8 /usr/bin/gem echo "." - fi -) + fi +) echo "Done installing the gems.." # Install bundler diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index d8d700bd8504fc2581ca480cdb4a74d3c13606b9..22e71befb372eb8c725d4718b68d4bf3b4fec718 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -24,7 +24,7 @@ describe PublicsController do user.reload user.visible_post_ids.include?(message.id).should be false - + xml = user2.salmon(message).xml_for(user.person) post :receive, :id => user.person.id, :xml => xml diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 272775771a60152c1cec605ab09abcb540d950db..0352d2bf2c96639642b9627f00a2ee446e41125d 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -20,11 +20,11 @@ describe UsersController do it "doesn't overwrite the profile photo when an empty string is passed in" do image_url = @user.person.profile.image_url - put("update", :id => @user.id, "user"=> {"profile"=> + put("update", :id => @user.id, "user"=> {"profile"=> {"image_url" => "", "last_name" => @user.person.profile.last_name, "first_name" => @user.person.profile.first_name}}) - + @user.person.profile.image_url.should == image_url end end @@ -33,33 +33,33 @@ describe UsersController do it 'should change a users password ' do old_password = @user.encrypted_password - put("update", :id => @user.id, "user"=> {"password" => "foobaz", 'password_confirmation' => "foobaz","profile"=> + put("update", :id => @user.id, "user"=> {"password" => "foobaz", 'password_confirmation' => "foobaz","profile"=> {"image_url" => "", "last_name" => @user.person.profile.last_name, - "first_name" => @user.person.profile.first_name}}) + "first_name" => @user.person.profile.first_name}}) @user.reload @user.encrypted_password.should_not == old_password end - it 'should not change a password if they do not match' do - old_password = @user.encrypted_password - put("update", :id => @user.id, "user"=> {"password" => "foobarz", 'password_confirmation' => "not_the_same","profile"=> + it 'should not change a password if they do not match' do + old_password = @user.encrypted_password + put("update", :id => @user.id, "user"=> {"password" => "foobarz", 'password_confirmation' => "not_the_same","profile"=> {"image_url" => "", "last_name" => @user.person.profile.last_name, - "first_name" => @user.person.profile.first_name}}) + "first_name" => @user.person.profile.first_name}}) @user.reload @user.encrypted_password.should == old_password end - - it 'should not update if the password fields are left blank' do - - old_password = @user.encrypted_password - put("update", :id => @user.id, "user"=> {"password" => "", 'password_confirmation' => "","profile"=> + + it 'should not update if the password fields are left blank' do + + old_password = @user.encrypted_password + put("update", :id => @user.id, "user"=> {"password" => "", 'password_confirmation' => "","profile"=> {"image_url" => "", "last_name" => @user.person.profile.last_name, - "first_name" => @user.person.profile.first_name}}) + "first_name" => @user.person.profile.first_name}}) @user.reload @user.encrypted_password.should == old_password end diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index 530dca21150987e0efb6ed104ec53252f8a7fc0f..d5722fd65aab481b73f713d062632942eabd7872 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -8,7 +8,7 @@ describe Diaspora::Parser do before do @user = Factory.create(:user, :email => "bob@aol.com") @aspect = @user.aspect(:name => 'spies') - + @user3 = Factory.create :user @person = @user3.person @user2 = Factory.create(:user) diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index e10ad5b48d5f0dd1575c3aafd7aecda6a6baf97a..40f928c18e3dd42b5cf4bf820070cc94ea9310f8 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -11,17 +11,17 @@ describe Salmon do let(:post){ user.post :status_message, :message => "hi", :to => user.aspect(:name => "sdg").id } let!(:created_salmon) {Salmon::SalmonSlap.create(user, post.to_diaspora_xml)} - + describe '#create' do it 'has data in the magic envelope' do created_salmon.magic_sig.data.should_not be nil end - + it 'has no parsed_data' do created_salmon.parsed_data.should be nil end - + it 'sets aes and iv key' do created_salmon.aes_key.should_not be nil created_salmon.iv.should_not be nil @@ -33,7 +33,7 @@ describe Salmon do user.aes_decrypt(decoded_string, key_hash).should == post.to_diaspora_xml end end - + describe '#xml_for' do let(:xml) {created_salmon.xml_for user2.person} @@ -50,7 +50,7 @@ describe Salmon do context 'marshaling' do let(:xml) {created_salmon.xml_for user2.person} - let(:parsed_salmon) { Salmon::SalmonSlap.parse(xml, user2)} + let(:parsed_salmon) { Salmon::SalmonSlap.parse(xml, user2)} it 'should parse out the aes key' do parsed_salmon.aes_key.should == created_salmon.aes_key diff --git a/spec/models/fb_status_spec.rb b/spec/models/fb_status_spec.rb index 368f8bd160f2f718354ed7a395a0f522bae910d2..2ab232fce0fb5e700019dc1e28de27721799bfc7 100644 --- a/spec/models/fb_status_spec.rb +++ b/spec/models/fb_status_spec.rb @@ -7,9 +7,9 @@ require File.dirname(__FILE__) + '/../spec_helper' describe FbStatus do - + let(:fb_status) { Factory.create :fb_status } - + it 'is valid' do fb_status.should be_valid end @@ -22,7 +22,7 @@ describe FbStatus do it 'has graph_id' do status_from_json.graph_id.should == json_object['id'] end - + it 'has author_id' do status_from_json.author_id.should == json_object['from']['id'] end @@ -39,5 +39,5 @@ describe FbStatus do status_from_json.updated_time.should == Time.parse(json_object['updated_time']) end end - + end diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 2188b106e46c93500d2f81543087d6ddf5fee9d9..a7fd8c5482ec47a116f61cbaddb33cda386a2a11 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -9,7 +9,7 @@ describe 'user encryption' do unstub_mocha_stubs @user = Factory.create(:user) @aspect = @user.aspect(:name => 'dudes') - + @user2 = Factory.create(:user) @aspect2 = @user2.aspect(:name => 'dudes') end