From 3c4b37dad7c782b354a7a7039db76456d6edd720 Mon Sep 17 00:00:00 2001 From: Diaspora Europe Date: Tue, 7 Feb 2012 20:39:50 +0100 Subject: [PATCH 1/2] PMs should always be displayed with the navigation. --- app/controllers/conversations_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/conversations_controller.rb b/app/controllers/conversations_controller.rb index 3915be1d6..ecfa5076e 100644 --- a/app/controllers/conversations_controller.rb +++ b/app/controllers/conversations_controller.rb @@ -53,7 +53,10 @@ class ConversationsController < ApplicationController @visibility.save end - respond_with @conversation + respond_to do |format| + format.html { redirect_to conversations_path(:conversation_id => @conversation.id) } + format.js + end else redirect_to conversations_path end From e4e1362ff52f79c560623d24220f2060c1d09eed Mon Sep 17 00:00:00 2001 From: Diaspora Europe Date: Wed, 8 Feb 2012 16:22:09 +0100 Subject: [PATCH 2/2] added spec for redirect to conversations_controller_spec --- spec/controllers/conversations_controller_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/controllers/conversations_controller_spec.rb b/spec/controllers/conversations_controller_spec.rb index c3e94af30..7d3bed8d9 100644 --- a/spec/controllers/conversations_controller_spec.rb +++ b/spec/controllers/conversations_controller_spec.rb @@ -136,13 +136,19 @@ describe ConversationsController do } @conversation = Conversation.create(hash) end - + it 'succeeds' do - get :show, :id => @conversation.id + get :show, :id => @conversation.id, :format => :js response.should be_success assigns[:conversation].should == @conversation end + it 'redirects to index' do + get :show, :id => @conversation.id + response.should redirect_to(conversations_path(:conversation_id => @conversation.id)) + assigns[:conversation].should == @conversation + end + it 'does not let you access conversations where you are not a recipient' do sign_in :user, eve