Updated creator helper

This commit is contained in:
Priit Tark 2015-03-23 17:21:45 +02:00
parent 7bc517530c
commit 717de1c886
2 changed files with 5 additions and 1 deletions

View file

@ -20,6 +20,7 @@ module ApplicationHelper
def creator_link(model) def creator_link(model)
return 'not present' if model.blank? return 'not present' if model.blank?
return 'unknown' if model.creator.blank?
return model.creator if model.creator.is_a? String return model.creator if model.creator.is_a? String
# can be api user or some other user # can be api user or some other user
@ -28,6 +29,7 @@ module ApplicationHelper
def updator_link(model) def updator_link(model)
return 'not present' if model.blank? return 'not present' if model.blank?
return 'unknown' if model.updator.blank?
return model.updator if model.updator.is_a? String return model.updator if model.updator.is_a? String
# can be api user or some other user # can be api user or some other user

View file

@ -20,6 +20,8 @@ feature 'Admin contact', type: :feature do
visit admin_contacts_url visit admin_contacts_url
click_link('Mr John') click_link('Mr John')
page.should have_content('by autotest') # initially it's created by unknown,
# indivitually running it's created by autotest
page.should have_content(/by [unknown|autotest]/)
end end
end end