diff --git a/app/views/conversations/index.haml b/app/views/conversations/index.haml index e2e79dbe2..19f4fe172 100644 --- a/app/views/conversations/index.haml +++ b/app/views/conversations/index.haml @@ -25,10 +25,10 @@ .row .col-md-1 - if @box == 'trash' - = link_to conversation_path(conversation, box: @box), method: :put do + = link_to conversation_path(conversation, box: @box), method: :put, class: 'restore' do = icon 'fas', 'trash-restore' - else - = link_to delete_icon, conversation_path(conversation, box: @box), method: :delete, class: 'text-danger' + = link_to delete_icon, conversation_path(conversation, box: @box), method: :delete, class: 'delete text-danger' .col-md-11 .text-right.float-right - conversation.recipients.each do |member| diff --git a/spec/features/conversations/index_spec.rb b/spec/features/conversations/index_spec.rb index 35f1107de..a4af6e257 100644 --- a/spec/features/conversations/index_spec.rb +++ b/spec/features/conversations/index_spec.rb @@ -19,6 +19,24 @@ describe "Notifications", :js do it { Percy.snapshot(page, name: 'conversations#index') } describe 'deleting' do + before do + # delete button + click_link class: 'delete' + end + + describe 'view trash' do + before { click_link 'trash' } + it { expect(page).to have_content 'something i want to say' } + describe 'restore conversation' do + before { click_link class: 'restore' } + it { expect(page).not_to have_content 'something i want to say' } + + describe 'conversation was restored' do + before { click_link 'inbox' } + it { expect(page).to have_content 'something i want to say' } + end + end + end end end end