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:
commit
a9b6426323
2 changed files with 12 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue