diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index e4e161dc0..dd284481f 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -22,7 +22,9 @@ class StatusMessagesController < ApplicationController @status_message = current_user.build_post(:status_message, params[:status_message]) - if photos || @status_message.save + if !photos.empty? || @status_message.save + pp photos + pp @status_message raise 'MongoMapper failed to catch a failed save' unless @status_message.id @status_message.photos += photos unless photos.nil? diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 4f052f998..a811bd678 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -29,7 +29,7 @@ Given /^I have an aspect called "([^"]*)"$/ do |aspect_name| end Given /^I have one contact request$/ do - other_user = make_user + other_user = Factory(:user) other_aspect = other_user.aspects.create!(:name => "meh") other_user.send_contact_request_to(@me.person, other_aspect) diff --git a/spec/controllers/status_message_controller_spec.rb b/spec/controllers/status_message_controller_spec.rb index a8df234bb..922441773 100644 --- a/spec/controllers/status_message_controller_spec.rb +++ b/spec/controllers/status_message_controller_spec.rb @@ -69,9 +69,7 @@ describe StatusMessagesController do it "doesn't overwrite id" do old_status_message = user1.post(:status_message, :message => "hello", :to => aspect1.id) status_message_hash[:status_message][:id] = old_status_message.id - lambda { - post :create, status_message_hash - }.should raise_error /failed save/ + post :create, status_message_hash old_status_message.reload.message.should == 'hello' end