Merge pull request #2839 from diasp/2036-fix-private-messages-navigation

#2036 Fix private messages are sometimes displayed without navigation
This commit is contained in:
Maxwell Salzberg 2012-02-08 16:59:50 -08:00
commit a9b6426323
2 changed files with 12 additions and 3 deletions

View file

@ -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

View file

@ -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