Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #199 from mallowlabs/id/199
Browse files Browse the repository at this point in the history
AbstractController::DoubleRenderError on search_more
  • Loading branch information
mallowlabs committed Jul 20, 2014
2 parents e4f496d + e9a4b44 commit 3a01fa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def search_more
if @results.size > 0
@messages = @results.first[:messages].reverse!
end
render :template => 'chat/messages', :layout => false
end
render :template => 'chat/messages', :layout => false
end

private
Expand Down
6 changes: 6 additions & 0 deletions spec/controllers/search_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
it { should be_nil }
end

context "存在しない部屋" do
before { get :search_more, :search_message => 'foo', :room_id => 'not_exisiting_room_id'}
subject { response }
it { should redirect_to(:controller => 'chat', :action => 'index') }
end

context "検索結果がある" do
before do
@room = mock
Expand Down

0 comments on commit 3a01fa1

Please sign in to comment.