Merge pull request #839 from internetee/registry-836

Registry 836
This commit is contained in:
Timo Võhmar 2018-05-04 14:00:08 +03:00 committed by GitHub
commit 878b6e745f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 19 deletions

View file

@ -1,5 +0,0 @@
module ContactHelper
def printable_street(street)
street.to_s.gsub("\n", '<br>').html_safe
end
end

View file

@ -62,7 +62,7 @@
- if contact.street.present?
%dt= t(:street)
%dd{class: changing_css_class(@version,"street")}= printable_street(contact.street)
%dd{class: changing_css_class(@version,"street")}= contact.street
- if contact.city.present?
%dt= t(:city)

View file

@ -8,7 +8,7 @@
%dd= @contact.org_name
%dt= t(:street)
%dd= printable_street(@contact.street)
%dd= @contact.street
%dt= t(:city)
%dd= @contact.city

View file

@ -1,12 +0,0 @@
require 'rails_helper'
RSpec.feature 'Contact list', settings: false do
background do
sign_in_to_admin_area
end
it 'is visible' do
visit admin_contacts_path
expect(page).to have_css('.contacts')
end
end

View file

@ -0,0 +1,25 @@
require 'test_helper'
class AdminContactsTest < ActionDispatch::IntegrationTest
def setup
super
@contact = contacts(:william)
login_as 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