From 6bd6e2e70bc665167dda0bff9119f2dd6e741887 Mon Sep 17 00:00:00 2001 From: Mischa The Evil Date: Thu, 8 Jun 2017 17:43:58 +0200 Subject: [PATCH 4/4] Add test assertions to the four controller test cases. --- test/functional/calendars_controller_test.rb | 11 +++++++++++ test/functional/gantts_controller_test.rb | 12 ++++++++++++ test/functional/issues_controller_test.rb | 11 +++++++++++ test/functional/time_entry_reports_controller_test.rb | 12 ++++++++++++ 4 files changed, 46 insertions(+) diff --git a/test/functional/calendars_controller_test.rb b/test/functional/calendars_controller_test.rb index 7c3a5ff..d6ce44e 100644 --- a/test/functional/calendars_controller_test.rb +++ b/test/functional/calendars_controller_test.rb @@ -36,6 +36,17 @@ class CalendarsControllerTest < Redmine::ControllerTest :project_id => 1 } assert_response :success + + # query form + assert_select 'form#query_form' do + assert_select 'div#query_form_with_buttons.hide-when-print' do + assert_select 'div#query_form_content' do + assert_select 'fieldset#filters.collapsible' + end + assert_select 'p.contextual' + assert_select 'p.buttons' + end + end end def test_show_should_run_custom_queries diff --git a/test/functional/gantts_controller_test.rb b/test/functional/gantts_controller_test.rb index bcd31ee..9a6ef6e 100644 --- a/test/functional/gantts_controller_test.rb +++ b/test/functional/gantts_controller_test.rb @@ -35,6 +35,18 @@ class GanttsControllerTest < Redmine::ControllerTest } assert_response :success + # query form + assert_select 'form#query_form' do + assert_select 'div#query_form_with_buttons.hide-when-print' do + assert_select 'div#query_form_content' do + assert_select 'fieldset#filters.collapsible' + assert_select 'fieldset#options' + end + assert_select 'p.contextual' + assert_select 'p.buttons' + end + end + # Issue with start and due dates i = Issue.find(1) assert_not_nil i.due_date diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index c6c58b6..c328a35 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -94,6 +94,17 @@ class IssuesControllerTest < Redmine::ControllerTest } assert_response :success + # query form + assert_select 'form#query_form' do + assert_select 'div#query_form_with_buttons.hide-when-print' do + assert_select 'div#query_form_content' do + assert_select 'fieldset#filters.collapsible' + assert_select 'fieldset#options' + end + assert_select 'p.buttons' + end + end + assert_select 'a[href="/issues/1"]', :text => /Cannot print recipes/ assert_select 'a[href="/issues/5"]', 0 end diff --git a/test/functional/time_entry_reports_controller_test.rb b/test/functional/time_entry_reports_controller_test.rb index fa9f9c8..52fdcff 100644 --- a/test/functional/time_entry_reports_controller_test.rb +++ b/test/functional/time_entry_reports_controller_test.rb @@ -37,6 +37,18 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest def test_report_at_project_level get :report, :params => {:project_id => 'ecookbook'} assert_response :success + + # query form + assert_select 'form#query_form' do + assert_select 'div#query_form_with_buttons.hide-when-print' do + assert_select 'div#query_form_content' do + assert_select 'fieldset#filters.collapsible' + assert_select 'fieldset#options' + end + assert_select 'p.buttons' + end + end + assert_select 'form#query_form[action=?]', '/projects/ecookbook/time_entries/report' end -- 1.9.1