mirror of
https://github.com/internetee/registry.git
synced 2025-08-11 12:09:34 +02:00
Merge pull request #2835 from internetee/adding_test_coverage/admin/bounced_mail_addresses_controller
Adding test coverage for bounced_mail_addresses_controller
This commit is contained in:
commit
c49cc357ab
1 changed files with 31 additions and 0 deletions
31
test/integration/admin_area/bounced_mail_addresses_test.rb
Normal file
31
test/integration/admin_area/bounced_mail_addresses_test.rb
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class AdminAreaBouncedMailAddressesIntegrationTest < ApplicationIntegrationTest
|
||||||
|
setup do
|
||||||
|
@bounced_mail = bounced_mail_addresses(:one)
|
||||||
|
sign_in users(:admin)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_index_returns_success
|
||||||
|
get admin_bounced_mail_addresses_path
|
||||||
|
|
||||||
|
assert_response :success
|
||||||
|
assert_match @bounced_mail.email, response.body
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_show_returns_success
|
||||||
|
get admin_bounced_mail_address_path(@bounced_mail)
|
||||||
|
|
||||||
|
assert_response :success
|
||||||
|
assert_match @bounced_mail.message_id, response.body
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_destroy_deletes_bounced_mail_address
|
||||||
|
assert_difference('BouncedMailAddress.count', -1) do
|
||||||
|
delete admin_bounced_mail_address_path(@bounced_mail)
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_redirected_to admin_bounced_mail_addresses_path
|
||||||
|
assert_raises(ActiveRecord::RecordNotFound) { @bounced_mail.reload }
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue