diff --git a/Gemfile b/Gemfile index e1d57cd1e..f2b895e32 100644 --- a/Gemfile +++ b/Gemfile @@ -1,16 +1,16 @@ source 'http://rubygems.org' -#gem 'rails', '3.0.0.rc' -#gem 'bundler', '1.0.0.rc.1' -gem 'rails', '3.0.0.beta4' -gem 'bundler', '0.9.26' +gem 'rails', '3.0.0.rc' +gem 'bundler', '1.0.0.rc.5' +#gem 'rails', '3.0.0.beta4' +#gem 'bundler', '0.9.26' #Security -gem 'gpgme' gem 'devise', :git => 'http://github.com/BadMinus/devise.git' #Mongo gem 'mongo_mapper', :git => 'http://github.com/BadMinus/mongomapper.git' +#gem 'mongo_mapper', :git => 'http://github.com/jnunemaker/mongomapper.git' gem 'jnunemaker-validatable', :git => 'http://github.com/BadMinus/validatable.git' gem 'mongo_ext' gem 'bson_ext' @@ -28,7 +28,7 @@ gem 'pubsubhubbub' gem 'redfinger' #EventMachine -gem 'em-http-request',:git => 'git://github.com/igrigorik/em-http-request.git', :ref => 'c6c494c514291f686cf6', :require => 'em-http' +gem 'em-http-request',:git => 'git://github.com/igrigorik/em-http-request.git', :require => 'em-http' gem 'em-websocket' gem 'thin' diff --git a/Rakefile b/Rakefile index 1db0cb5f2..0655d29d1 100644 --- a/Rakefile +++ b/Rakefile @@ -4,4 +4,4 @@ require File.expand_path('../config/application', __FILE__) require 'rake' ENV['GNUPGHOME'] = File.expand_path("../../gpg/diaspora-#{Rails.env}/", __FILE__) -Rails::Application.load_tasks +Diaspora::Application.load_tasks diff --git a/app/helpers/albums_helper.rb b/app/helpers/albums_helper.rb index 19df7bd01..337ce608f 100644 --- a/app/helpers/albums_helper.rb +++ b/app/helpers/albums_helper.rb @@ -14,13 +14,4 @@ module AlbumsHelper 'Your Albums' end end - - def album_person(album) - person = album.person - if album.person_id == current_user.id - link_to "you", user_path(current_user) - else - link_to person.real_name, person_path(person) - end - end end diff --git a/app/models/album.rb b/app/models/album.rb index b30cb5c45..b10f63acd 100644 --- a/app/models/album.rb +++ b/app/models/album.rb @@ -1,16 +1,8 @@ -class Album - require 'lib/diaspora/webhooks' - include MongoMapper::Document - include ROXML - include Diaspora::Webhooks - include Encryptable +class Album < Post xml_reader :name - xml_reader :person, :as => Person - xml_reader :_id key :name, String - belongs_to :person, :class_name => 'Person' many :photos, :class_name => 'Photo', :foreign_key => :album_id timestamps! @@ -18,16 +10,10 @@ class Album validates_presence_of :name, :person before_destroy :destroy_photos - after_save :notify_people - before_destroy :propagate_retraction - def self.instantiate params - self.create params - end def self.mine_or_friends(friend_param, current_user) if friend_param - puts "i am working" Album.find_all_by_person_id(current_user.friend_ids) else current_user.person.albums @@ -44,30 +30,9 @@ class Album p_photo ? p_photo : self.photos.sort(:created_at.desc).last end - #ENCRYPTION - xml_accessor :creator_signature - key :creator_signature, String - - def signable_accessors - accessors = self.class.roxml_attrs.collect{|definition| - definition.accessor} - accessors.delete 'person' - accessors.delete 'creator_signature' - accessors - end - - def signable_string - signable_accessors.collect{|accessor| - (self.send accessor.to_sym).to_s}.join ';' - end - - protected def destroy_photos - photos.each{|p| p.destroy} + self.photos.each{|p| p.destroy} end - def propagate_retraction - self.person.owner.retract(self) - end end diff --git a/app/models/person.rb b/app/models/person.rb index 26236a5b8..32d68cab8 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -55,15 +55,6 @@ class Person encryption_key.public_key.export end - ##profile - def update_profile(params) - if self.update_attributes(params) - self.profile.notify_people! - true - else - false - end - end def owns?(post) self.id == post.person.id diff --git a/app/models/photo.rb b/app/models/photo.rb index d93a1189a..bedcdc143 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -30,20 +30,30 @@ class Photo < Post validates_true_for :album_id, :logic => lambda {self.validate_album_person} before_destroy :ensure_user_picture - + key :remote_photo_path + key :remote_photo_name def validate_album_person album.person_id == person_id end - + def remote_photo - @remote_photo ||= self.person.url.chop + image.url + image.url.nil? ? (remote_photo_path + '/' + remote_photo_name) : image.url end def remote_photo= remote_path - @remote_photo = remote_path - image.download! remote_path - image.store! + name_start = remote_path.rindex '/' + self.remote_photo_path = remote_path.slice(0, name_start ) + self.remote_photo_name = remote_path.slice(name_start + 1, remote_path.length) + end + + def url(name = nil) + if remote_photo_path + name = name.to_s + "_" if name + person.url.chop + remote_photo_path + "/" + name.to_s + remote_photo_name + else + image.url name + end end def ensure_user_picture diff --git a/app/models/status_message.rb b/app/models/status_message.rb index 3fb9aa39d..4c43a2244 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -1,5 +1,4 @@ class StatusMessage < Post - #include StatusMessagesHelper xml_name :status_message xml_accessor :message diff --git a/app/models/user.rb b/app/models/user.rb index 145230097..b90bb9df1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -60,19 +60,21 @@ class User post = model_class.instantiate(options) post.creator_signature = post.sign_with_key(encryption_key) post.save - post.notify_people + + + if group_id + group = self.groups.find_by_id(group_id) + group.posts << post + group.save + post.push_to( group.people.all ) + else + post.push_to( self.friends.all ) + end post.socket_to_uid(id) if post.respond_to?(:socket_to_uid) self.raw_visible_posts << post self.save - - if group_id - group = self.groups.find_by_id(group_id) - group.posts << post - group.save - end - post end @@ -115,10 +117,20 @@ class User post.unsocket_from_uid(self.id) if post.respond_to? :unsocket_from_uid retraction = Retraction.for(post) retraction.creator_signature = retraction.sign_with_key( encryption_key ) - retraction.notify_people + retraction.push_to( self.friends.all ) retraction end + ########### Profile ###################### + def update_profile(params) + if self.person.update_attributes(params) + self.profile.push_to( self.friends.all ) + true + else + false + end + end + ######### Friend Requesting ########### def send_friend_request_to(friend_url, group_id) unless self.friends.detect{ |x| x.receive_url == friend_url} @@ -254,6 +266,10 @@ class User else object.perform self.id + groups = self.groups_with_person(object.person) + groups.each{ |group| group.post_ids.delete(ensure_bson(object.post_id)) + group.save + } end elsif object.is_a? Request person = Diaspora::Parser.get_or_create_person_object_from_xml( xml ) diff --git a/app/uploaders/image_uploader.rb b/app/uploaders/image_uploader.rb index 2a55e3059..3fd36c6a6 100644 --- a/app/uploaders/image_uploader.rb +++ b/app/uploaders/image_uploader.rb @@ -1,10 +1,10 @@ class ImageUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick - storage :grid_fs + storage :file def store_dir - "files" + "uploads/images" end def extension_white_list diff --git a/app/views/albums/_album.html.haml b/app/views/albums/_album.html.haml index 52cb7fe4a..bf28846b5 100644 --- a/app/views/albums/_album.html.haml +++ b/app/views/albums/_album.html.haml @@ -5,11 +5,11 @@ %div.time by - = album_person(post) + = link_to ((current_user.person == post.person)? 'you' : post.person.real_name), person_path(post.person) %br = link_to(how_long_ago(post), object_path(post)) %div.image_cycle - for photo in post.photos[0..3] - = link_to (image_tag photo.image.url(:thumb_large)), album_path(post) + = link_to (image_tag photo.url(:thumb_large)), album_path(post) diff --git a/app/views/albums/edit.html.haml b/app/views/albums/edit.html.haml index b505cf76b..18cb8b644 100644 --- a/app/views/albums/edit.html.haml +++ b/app/views/albums/edit.html.haml @@ -13,7 +13,7 @@ %ul - for photo in @album.photos - %li.photo_edit_block= image_tag photo.image.url(:thumb_large) + %li.photo_edit_block= image_tag photo.url(:thumb_large) #submit_block = link_to "Cancel", root_path diff --git a/app/views/albums/show.html.haml b/app/views/albums/show.html.haml index b63dea9de..04b117645 100644 --- a/app/views/albums/show.html.haml +++ b/app/views/albums/show.html.haml @@ -22,7 +22,7 @@ #thumbnails - for photo in @album_photos .image_thumb - = link_to (image_tag photo.image.url(:thumb_medium)), object_path(photo) + = link_to (image_tag photo.url(:thumb_medium)), object_path(photo) #content_bottom .back diff --git a/app/views/groups/index.html.haml b/app/views/groups/index.html.haml index d46e122f7..89ef12f84 100644 --- a/app/views/groups/index.html.haml +++ b/app/views/groups/index.html.haml @@ -1,4 +1,10 @@ -= render "shared/publisher", :group_id => @group.id +%h1 + welcome, + = current_user.profile.first_name + +- @group.nil? ? group_id = nil : group_id = @group.id + += render "shared/publisher", :group_id => group_id %ul#stream - for post in @posts diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 62d0c4eb1..006872e5b 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -24,8 +24,6 @@ = csrf_meta_tag = yield(:head) - /= javascript_include_tag 'satisfaction' , 'satisfaction-display' - = javascript_include_tag 'jquery.html5_upload' %body diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index e6734639a..e15dcb0d5 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -8,7 +8,7 @@ = link_to post.album.name, object_path(post.album) %br - = link_to (image_tag post.image.url(:thumb_large)), object_path(post) + = link_to (image_tag post.url(:thumb_large)), object_path(post) %div.time = link_to(how_long_ago(post), photo_path(post)) diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 05443591f..8636998b3 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -8,7 +8,7 @@ .sub_header = link_to_prev @photo, @album | - = link_to "full size", @photo.image.url + = link_to "full size", @photo.url | = link_to_next @photo, @album diff --git a/app/views/posts/_debug.haml b/app/views/posts/_debug.haml index ad1b3f1d8..a5cb32b7b 100644 --- a/app/views/posts/_debug.haml +++ b/app/views/posts/_debug.haml @@ -1,6 +1,6 @@ #debug_info %h5 DEBUG INFO - #debug_more{ :style => "display:none;" } + #debug_more %ul %li %b params diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index fe52ac354..710b0d2bc 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -4,7 +4,8 @@ = form_for StatusMessage.new, :remote => true do |f| = f.error_messages - = f.hidden_field :group_id, :value => group_id + -if group_id + = f.hidden_field :group_id, :value => group_id %p %label{:for => "status_message_message"} Message diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index fa1136fec..24aa8e7f0 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -15,14 +15,14 @@ %div#image_picker = p.hidden_field :image_url, :value => @profile.image_url, :id => 'image_url_field' - for photo in @photos - - if photo.image.url(:thumb_medium) == @profile.image_url + - if photo.url(:thumb_medium) == @profile.image_url %div.small_photo{:id => photo.image.thumb_medium.url, :class=>'selected'} = check_box_tag 'checked_photo', true, true - = link_to image_tag(photo.image.url(:thumb_medium)), "#" + = link_to image_tag(photo.url(:thumb_medium)), "#" - else %div.small_photo{:id => photo.image.thumb_medium.url} = check_box_tag 'checked_photo' - = link_to image_tag(photo.image.url(:thumb_medium)), "#" + = link_to image_tag(photo.url(:thumb_medium)), "#" =will_paginate @photos diff --git a/config/application.rb b/config/application.rb index 5d5b90b54..206139b5e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -15,8 +15,8 @@ module Diaspora # -- all .rb files in that directory are automatically loaded. # Add additional load paths for your own custom dirs - # config.load_paths += %W( #{config.root}/extras ) - + config.autoload_paths += %W(#{config.root}/lib) + # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named # config.plugins = [ :exception_notification, :ssl_requirement, :all ] diff --git a/config/environments/test.rb b/config/environments/test.rb index 7f40c884b..7615ffb1e 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -24,6 +24,7 @@ Diaspora::Application.configure do # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test + config.active_support.deprecation = :stderr config.threadsafe! diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index ed6e8bb4e..0fe280e02 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -1,7 +1,3 @@ CarrierWave.configure do |config| - config.grid_fs_database = MongoMapper::database.name - config.grid_fs_host = MongoMapper::connection.host - config.grid_fs_access_url = "/images" - config.storage = :grid_fs - #config.storage = :file + config.storage = :file end diff --git a/config/routes.rb b/config/routes.rb index 237179d9e..b0e12b30b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,8 +8,6 @@ Diaspora::Application.routes.draw do |map| resources :albums resources :groups - match "/images/files/*path" => "gridfs#serve" - match 'warzombie', :to => "dev_utilities#warzombie" match 'zombiefriends', :to => "dev_utilities#zombiefriends" match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept" diff --git a/lib/diaspora/webhooks.rb b/lib/diaspora/webhooks.rb index dba3968e2..d0d555a2a 100644 --- a/lib/diaspora/webhooks.rb +++ b/lib/diaspora/webhooks.rb @@ -6,16 +6,6 @@ module Diaspora @@queue = MessageHandler.new - def notify_people - unless self.person.owner.nil? - push_to(people_with_permissions) - end - end - - def notify_people! - push_to(people_with_permissions) - end - def push_to(recipients) unless recipients.empty? recipients.map!{|x| x = x.receive_url } diff --git a/public/javascripts/fancybox/jquery.fancybox-1.3.1.js b/public/javascripts/fancybox/jquery.fancybox-1.3.1.js index 688f93aa3..2209ceadc 100644 --- a/public/javascripts/fancybox/jquery.fancybox-1.3.1.js +++ b/public/javascripts/fancybox/jquery.fancybox-1.3.1.js @@ -1074,4 +1074,4 @@ fancybox_init(); }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/public/javascripts/satisfaction-display.js b/public/javascripts/satisfaction-display.js deleted file mode 100644 index e72e66809..000000000 --- a/public/javascripts/satisfaction-display.js +++ /dev/null @@ -1,10 +0,0 @@ - var feedback_widget_options = {}; - - feedback_widget_options.display = "overlay"; - feedback_widget_options.company = "diaspora"; - feedback_widget_options.placement = "right"; - feedback_widget_options.color = "#222"; - feedback_widget_options.style = "idea"; - - - var feedback_widget = new GSFN.feedback_widget(feedback_widget_options); diff --git a/public/javascripts/satisfaction.js b/public/javascripts/satisfaction.js deleted file mode 100644 index b8efb5890..000000000 --- a/public/javascripts/satisfaction.js +++ /dev/null @@ -1,3 +0,0 @@ - var is_ssl = ("https:" == document.location.protocol); - var asset_host = is_ssl ? "https://s3.amazonaws.com/getsatisfaction.com/" : "http://s3.amazonaws.com/getsatisfaction.com/"; - document.write(unescape("%3Cscript src='" + asset_host + "javascripts/feedback-v2.js' type='text/javascript'%3E%3C/script%3E")); diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 6648c1714..aa87fda21 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -85,7 +85,7 @@ $(document).ready(function(){ $("#add_album_button").fancybox(); $("#add_group_button").fancybox(); - $("#add_request_button").fancybox(); + $("#add_request_button").fancybox({ 'titleShow': false }); $("#add_photo_button").fancybox(); //pane_toggler_button("photo"); diff --git a/spec/factories.rb b/spec/factories.rb index ba3aadeb9..91d29e0dd 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -49,7 +49,7 @@ Factory.define :post do |p| end Factory.define :photo do |p| - p.image File.open( File.dirname(__FILE__) + '/fixtures/bp.jpeg') + p.image File.open( File.dirname(__FILE__) + '/fixtures/button.png') end diff --git a/spec/fixtures/bp.jpeg b/spec/fixtures/bp.jpeg deleted file mode 100644 index 33f75aa04..000000000 Binary files a/spec/fixtures/bp.jpeg and /dev/null differ diff --git a/spec/fixtures/button.png b/spec/fixtures/button.png new file mode 100644 index 000000000..6248f1b88 Binary files /dev/null and b/spec/fixtures/button.png differ diff --git a/spec/lib/web_hooks_spec.rb b/spec/lib/web_hooks_spec.rb index 63739f636..5996a6e3a 100644 --- a/spec/lib/web_hooks_spec.rb +++ b/spec/lib/web_hooks_spec.rb @@ -17,20 +17,7 @@ describe Diaspora do end it "should add the following methods to Post on inclusion" do - @post.respond_to?(:notify_people).should be true @post.respond_to?(:to_diaspora_xml).should be true - @post.respond_to?(:people_with_permissions).should be true - end - - it "should retrieve all valid person endpoints" do - @user.friends << Factory.create(:person, :url => "http://www.bob.com/") - @user.friends << Factory.create(:person, :url => "http://www.alice.com/") - @user.friends << Factory.create(:person, :url => "http://www.jane.com/") - @user.save - - @post.person.owner.reload - - @post.people_with_permissions.should == @user.friends end it "should send an owners post to their people" do diff --git a/spec/models/album_spec.rb b/spec/models/album_spec.rb index e31dc5e4a..f1d40dd90 100644 --- a/spec/models/album_spec.rb +++ b/spec/models/album_spec.rb @@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../spec_helper' describe Album do before do - @fixture_name = File.dirname(__FILE__) + '/../fixtures/bp.jpeg' + @fixture_name = File.dirname(__FILE__) + '/../fixtures/button.png' @user = Factory.create(:user) @user.person.save @album = Album.new(:name => "test collection", :person => @user.person) diff --git a/spec/models/comments_spec.rb b/spec/models/comments_spec.rb index 6d6aa7c3c..a9066f6d0 100644 --- a/spec/models/comments_spec.rb +++ b/spec/models/comments_spec.rb @@ -52,7 +52,7 @@ describe Comment do end it 'should send a user comment on his own post to lots of people' do - allowed_urls = @user_status.people_with_permissions.map{|x| x = x.receive_url} + allowed_urls = @user.friends.map!{ |x| x = x.receive_url } message_queue.should_receive(:add_post_request).with(allowed_urls, anything) @user.comment "yo", :on => @user_status end diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 530bcec8c..dc0920a66 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -68,16 +68,16 @@ describe Group do describe 'posting' do it 'should add post to group via post method' do - @group = @user.group(:name => 'losers', :people => [@friend]) + group = @user.group(:name => 'losers', :people => [@friend]) - status_message = @user.post( :status_message, :message => "hey", :group_id => @group.id ) + status_message = @user.post( :status_message, :message => "hey", :group_id => group.id ) - @group.reload - @group.posts.include?(status_message).should be true + group.reload + group.posts.include?(status_message).should be true end it 'should add post to group via receive method' do - group = @user.group(:name => 'losers') + group = @user.group(:name => 'losers') group2 = @user2.group(:name => 'winners') friend_users(@user, group, @user2, group2) @@ -90,5 +90,24 @@ describe Group do @user.visible_posts(:by_members_of => group).include?(message).should be true end + it 'should retract the post from the groups as well' do + group = @user.group(:name => 'losers') + group2 = @user2.group(:name => 'winners') + friend_users(@user, group, @user2, group2) + + message = @user2.post(:status_message, :message => "Hey Dude") + + @user.receive message.to_diaspora_xml + group.reload + + group.post_ids.include?(message.id).should be true + + retraction = @user2.retract(message) + @user.receive retraction.to_diaspora_xml + + group.reload + group.post_ids.include?(message.id).should be false + end end + end diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 2562b1055..b0ad79b83 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -5,8 +5,8 @@ describe Photo do @user = Factory.create(:user) @user.person.save - @fixture_filename = 'bp.jpeg' - @fixture_name = File.dirname(__FILE__) + '/../fixtures/bp.jpeg' + @fixture_filename = 'button.png' + @fixture_name = File.dirname(__FILE__) + '/../fixtures/button.png' @fail_fixture_name = File.dirname(__FILE__) + '/../fixtures/msg.xml' @album = Album.create(:name => "foo", :person => @user.person) @photo = Photo.new(:person => @user.person, :album => @album) @@ -19,7 +19,7 @@ describe Photo do photo.image.read.nil?.should be false end - it 'should save a photo to GridFS' do + it 'should save a photo' do @photo.image.store! File.open(@fixture_name) @photo.save.should == true binary = @photo.image.read @@ -58,7 +58,6 @@ describe Photo do end it 'should not use the imported filename as the url' do - pending "Until this passes, duplicate photos will cause errors" @photo.image.store! File.open(@fixture_name) @photo.image.url.include?(@fixture_filename).should be false @photo.image.url(:thumb_medium).include?("/" + @fixture_filename).should be false @@ -85,7 +84,7 @@ describe Photo do stub_signature_verification end - it 'should save a signed photo to GridFS' do + it 'should save a signed photo' do photo = @user.post(:photo, :album => @album, :user_file => [File.open(@fixture_name)]) photo.save.should == true photo.signature_valid?.should be true @@ -109,5 +108,26 @@ describe Photo do xml = @photo.to_xml.to_s xml.include?(@photo.album_id.to_s).should be true end + + it 'should set the remote_photo on marshalling' do + @photo.image.store! File.open(@fixture_name) + + @photo.save + @photo.reload + + url = @photo.url + thumb_url = @photo.url :thumb_medium + + xml = @photo.to_diaspora_xml + id = @photo.id + + @photo.destroy + @user.receive xml + + new_photo = Photo.first(:id => id) + new_photo.url.nil?.should be false + new_photo.url.include?(url).should be true + new_photo.url(:thumb_medium).include?(thumb_url).should be true + end end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 8c3bf95b5..548966548 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -14,7 +14,7 @@ describe User do message_queue.should_receive(:process) - @user.person.update_profile(updated_profile).should == true + @user.update_profile(updated_profile).should == true @user.profile.image_url.should == "http://clown.com" end end