summaryrefslogtreecommitdiff
path: root/test/controllers/conversations/hides_controller_test.rb
blob: 60b1bb41828648747a174ea70527356d3dc2a039 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

require 'test_helper'

class Conversations::HidesControllerTest < ActionController::TestCase
  setup do
    @conversation = create(:conversation_with_messages)
    @from = @conversation.from
    sign_in @from
  end

  test 'can hide a conversation' do
    post :create, params: { conversation_id: @conversation.slug }

    @conversation.reload
    assert_response :redirect
    assert @conversation.from_hidden
    assert_not @conversation.to_hidden
  end
end