Skip to content

Commit c49cc35

Browse files
authored
Merge pull request #2835 from internetee/adding_test_coverage/admin/bounced_mail_addresses_controller
Adding test coverage for bounced_mail_addresses_controller
2 parents 961feb8 + 4addaea commit c49cc35

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
require 'test_helper'
2+
3+
class AdminAreaBouncedMailAddressesIntegrationTest < ApplicationIntegrationTest
4+
setup do
5+
@bounced_mail = bounced_mail_addresses(:one)
6+
sign_in users(:admin)
7+
end
8+
9+
def test_index_returns_success
10+
get admin_bounced_mail_addresses_path
11+
12+
assert_response :success
13+
assert_match @bounced_mail.email, response.body
14+
end
15+
16+
def test_show_returns_success
17+
get admin_bounced_mail_address_path(@bounced_mail)
18+
19+
assert_response :success
20+
assert_match @bounced_mail.message_id, response.body
21+
end
22+
23+
def test_destroy_deletes_bounced_mail_address
24+
assert_difference('BouncedMailAddress.count', -1) do
25+
delete admin_bounced_mail_address_path(@bounced_mail)
26+
end
27+
28+
assert_redirected_to admin_bounced_mail_addresses_path
29+
assert_raises(ActiveRecord::RecordNotFound) { @bounced_mail.reload }
30+
end
31+
end

0 commit comments

Comments
 (0)