File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
app/controllers/better_together
spec/requests/better_together Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ def set_conversation # rubocop:todo Metrics/MethodLength
226226 :contact_detail ,
227227 { profile_image_attachment : :blob }
228228 ] )
229- @conversation = scope . find_by ( id : params [ :id ] )
229+ @conversation = scope . find ( params [ :id ] )
230230 @set_conversation ||= Conversation . includes ( participants : [
231231 :string_translations ,
232232 :contact_detail ,
Original file line number Diff line number Diff line change 8080 end
8181 end
8282
83+ describe 'GET /conversations/:id' do
84+ context 'as a non-participant' , :as_user do # rubocop:todo RSpec/ContextWording
85+ it 'returns not found' do
86+ conversation = create ( 'better_together/conversation' , creator : manager_user . person ) . tap do |c |
87+ c . participants << manager_user . person unless c . participants . exists? ( manager_user . person . id )
88+ end
89+
90+ get better_together . conversation_path ( conversation , locale : I18n . default_locale )
91+ expect ( response ) . to have_http_status ( :not_found )
92+ end
93+ end
94+ end
95+
8396 describe 'PATCH /conversations/:id' do
8497 context 'as a regular member' , :as_user do # rubocop:todo RSpec/ContextWording
8598 let! ( :conversation ) do
You can’t perform that action at this time.
0 commit comments