https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292018-01-17T10:39:10ZRedmineRedmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=831832018-01-17T10:39:10ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>4.0.0</i></li></ul><p>Setting target version to 4.0.0.</p> Redmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=831912018-01-17T12:31:06ZToshi MARUYAMA
<ul><li><strong>Target version</strong> deleted (<del><i>4.0.0</i></del>)</li></ul><p>Could you add test?<br /><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/test/functional/auth_sources_controller_test.rb#L154">source:trunk/test/functional/auth_sources_controller_test.rb#L154</a></p> Redmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=831952018-01-17T13:28:53ZGo MAEDA
<ul><li><strong>File</strong> <a href="/attachments/19925">show-ldap-deletion-error-v2.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/19925/show-ldap-deletion-error-v2.diff">show-ldap-deletion-error-v2.diff</a> added</li></ul><p>Added an assertion in the test.</p> Redmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=831962018-01-17T13:48:22ZToshi MARUYAMA
<ul></ul><p>You can use raw English text and I think you can use "assert_select_error".<br /><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/test/functional/auth_sources_controller_test.rb#L142">source:trunk/test/functional/auth_sources_controller_test.rb#L142</a></p> Redmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=831982018-01-17T14:10:21ZGo MAEDA
<ul></ul><p>Toshi MARUYAMA wrote:</p>
<blockquote>
<p>You can use raw English text and I think you can use "assert_select_error".<br /><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/test/functional/auth_sources_controller_test.rb#L142">source:trunk/test/functional/auth_sources_controller_test.rb#L142</a></p>
</blockquote>
<p>Do you think using raw text is better? I think I18n.t is better because we don't have to update the test when the English translation for error_can_not_delete_auth_source is changed. And we cannot use <code>assert_select_error</code> for the page because there isn't "div#errorExplanation".</p> Redmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=832212018-01-18T23:42:44ZGo MAEDA
<ul></ul><p>Toshi MARUYAMA wrote:</p>
<blockquote>
<p>You can use raw English text and I think you can use "assert_select_error".<br /><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/test/functional/auth_sources_controller_test.rb#L142">source:trunk/test/functional/auth_sources_controller_test.rb#L142</a></p>
</blockquote>
<p>I think that checking the <code>flash</code> hash is a common way to test flash notices. Please see <a href="http://guides.rubyonrails.org/testing.html#testing-flash-notices" class="external">7.7 Testing flash notices</a> on Rails Guides. Also in Redmine, the same way is used. Examples as follows:</p>
<ul>
<li><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/3.4.4/test/functional/timelog_controller_test.rb#L678">source:tags/3.4.4/test/functional/timelog_controller_test.rb#L678</a></li>
<li><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/3.4.4/test/functional/timelog_controller_test.rb#L689">source:tags/3.4.4/test/functional/timelog_controller_test.rb#L689</a></li>
<li><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/tags/3.4.4/test/functional/my_controller_test.rb#L362">source:tags/3.4.4/test/functional/my_controller_test.rb#L362</a></li>
</ul>
<p>I think that <code>assert_select_error</code> can be used for validation errors brought by <code>ActiveRecord::Errors</code> object but cannot be used for <code>flash</code> hash.</p> Redmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=832252018-01-19T03:54:45ZToshi MARUYAMA
<ul></ul><p>Go MAEDA wrote:</p>
<blockquote>
<p>Toshi MARUYAMA wrote:</p>
<blockquote>
<p>You can use raw English text and I think you can use "assert_select_error".<br /><a class="source" href="https://www.redmine.org/projects/redmine/repository/svn/entry/trunk/test/functional/auth_sources_controller_test.rb#L142">source:trunk/test/functional/auth_sources_controller_test.rb#L142</a></p>
</blockquote>
<p>Do you think using raw text is better?</p>
</blockquote>
<p>Yes. Rails changed behaviour many times. It cannot guarantee test result in the future.</p> Redmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=832372018-01-19T11:42:42ZJens Krämerjk@jkraemer.net
<ul></ul><p>I agree with Toshi, using the raw text in the assertion is preferable. It simplifies the statement and makes it more obvious what is expected.</p> Redmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=832442018-01-20T02:11:46ZGo MAEDA
<ul><li><strong>File</strong> <a href="/attachments/19946">show-ldap-deletion-error-v3.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/19946/show-ldap-deletion-error-v3.diff">show-ldap-deletion-error-v3.diff</a> added</li></ul><p>Toshi MARUYAMA and Jens Krämer, thank you for your advice!<br />I have updated the test to use raw text.</p> Redmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=832582018-01-21T00:31:46ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>4.0.0</i></li></ul><p>I fixed the patch as advised by Toshi and Jens. Setting target version to 4.0.0 again.</p> Redmine - Defect #28000: Deletion of an LDAP authentication mode may fail silentlyhttps://www.redmine.org/issues/28000?journal_id=839502018-03-12T04:42:38ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Committed.</p>