diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c7decf1ce..e0b4d9cab 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -44,9 +44,9 @@ class UsersController < ApplicationController else flash[:error] = I18n.t 'users.update.language_not_changed' end - - redirect_to edit_user_path(@user) end + + redirect_to edit_user_path(@user) end def destroy diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 26971940b..be42ddbd5 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -105,11 +105,27 @@ describe User do user.dispatch_post(status, :to => "all") end - it 'includes a permalink to my post' do + it 'does not include a permalink' do @status_opts[:public] = true status.save - user.should_receive(:post_to_twitter).with(service1, @message+ " #{post_path(status)}").once - user.should_receive(:post_to_facebook).with(service2, @message + " #{post_path(status)}").once + user.should_receive(:post_to_twitter).with(service1, @message).once + user.should_receive(:post_to_facebook).with(service2, @message).once + user.dispatch_post(status, :to => "all", :url => post_path(status)) + end + + it 'includes a permalink' do + fixture_filename = 'button.png' + fixture_name = File.join(File.dirname(__FILE__), '..', '..', 'fixtures', fixture_filename) + + photo1 = user.build_post(:photo, :user_file=> File.open(fixture_name), :to => aspect.id) + photo1.save! + + @status_opts[:public] = true + @status_opts[:photo_id] = photo1.id + status.save + + user.should_receive(:post_to_twitter).with(service1, @message).once + user.should_receive(:post_to_facebook).with(service2, @message).once user.dispatch_post(status, :to => "all", :url => post_path(status)) end