mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
* Create new class called ApplicationIntegrationTest, so we don't have to override ActionDispatch::IntegrationTest * Move UI tests to inherit from ApplicationSystemTestCase * Existing REST API or EPP tests inherit from ApplicationIntegrationTest. * Move `require 'application_system_test_case'` at the end of `test_helper` I don't particularly agree with the Rails' convention of treating UI tests as system tests and API tests as integration tests, but I see no benefit in actively fighting against it.
25 lines
534 B
Ruby
25 lines
534 B
Ruby
require 'test_helper'
|
|
|
|
class AdminContactsTest < ApplicationSystemTestCase
|
|
def setup
|
|
super
|
|
|
|
@contact = contacts(:william)
|
|
sign_in users(:admin)
|
|
end
|
|
|
|
def test_display_list
|
|
visit admin_contacts_path
|
|
|
|
assert_text('william-001')
|
|
assert_text('william-002')
|
|
assert_text('acme-ltd-001')
|
|
end
|
|
|
|
def test_display_details
|
|
visit admin_contact_path(@contact)
|
|
|
|
assert_text('Street Main Street City New York Postcode 12345 ' \
|
|
'State New York Country United States of America')
|
|
end
|
|
end
|