tests for restoring conversations

This commit is contained in:
Brenda Wallace
2019-08-07 22:27:01 +12:00
parent cafbfb349f
commit dc59b487ca
2 changed files with 20 additions and 2 deletions

View File

@@ -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|

View File

@@ -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