improve test for date macro

This commit is contained in:
Alexander Meindl 2018-12-08 21:08:48 +01:00
parent f5b4cdbda5
commit 59ca276566

View File

@ -321,10 +321,24 @@ class WikiControllerTest < Additionals::ControllerTest
params: { project_id: 1, id: @page_name }
assert_response :success
assert_select 'div.wiki', html: /{{date/, count: 0
assert_select 'div.wiki span.current-date', count: 9
assert_select 'div.wiki span.current-date', User.current.today.cweek.to_s
end
def test_show_with_date_macro_and_invalid_type
@request.session[:user_id] = WIKI_MACRO_USER_ID
@page.content.text = '{{date(invalid_type_name)}}'
@page.content.save!
get :show,
params: { project_id: 1, id: @page_name }
assert_response :success
assert_select 'div.wiki', html: /{{date/
end
def test_show_issue
@request.session[:user_id] = WIKI_MACRO_USER_ID
@page.content.text = '{{issue(2, format=short)}}'