mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
commit
878b6e745f
5 changed files with 27 additions and 19 deletions
|
@ -1,5 +0,0 @@
|
|||
module ContactHelper
|
||||
def printable_street(street)
|
||||
street.to_s.gsub("\n", '<br>').html_safe
|
||||
end
|
||||
end
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
25
test/integration/admin/contacts_test.rb
Normal file
25
test/integration/admin/contacts_test.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue