Patch #31965

Add missing fixtures to Redmine::ApiTest::VersionsTest

Added by Yuichi HARADA 22 days ago. Updated 22 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:4.1.0

Description

Redmine::ApiTest::VersionsTest has failed.

$ RAILS_ENV=test bundle exec rake db:migrate:reset

$ RAILS_ENV=test bundle exec rake test TEST=test/integration/api_test/versions_test.rb
Run options: --seed 7320

# Running:

.E

Error:
Redmine::ApiTest::VersionsTest#test_POST_/projects/:project_id/versions.xml_should_create_the_version_with_wiki_page_title:
NoMethodError: undefined method `title' for nil:NilClass
    test/integration/api_test/versions_test.rb:77:in `block (2 levels) in <class:VersionsTest>'
    test/integration/api_test/versions_test.rb:75:in `block in <class:VersionsTest>'

bin/rails test test/integration/api_test/versions_test.rb:74

..E

Error:
Redmine::ApiTest::VersionsTest#test_PUT_/versions/:id.xml_should_update_the_version:
NoMethodError: undefined method `title' for nil:NilClass
    test/integration/api_test/versions_test.rb:141:in `block in <class:VersionsTest>'

bin/rails test test/integration/api_test/versions_test.rb:139

....

Finished in 1.188608s, 7.5719 runs/s, 29.4462 assertions/s.
9 runs, 35 assertions, 0 failures, 2 errors, 0 skips

I think that because the fixtures is not enough.

diff --git a/test/integration/api_test/versions_test.rb b/test/integration/api_test/versions_test.rb
index 4a9bb93fa..d5385b855 100644
--- a/test/integration/api_test/versions_test.rb
+++ b/test/integration/api_test/versions_test.rb
@@ -27,7 +27,8 @@ class Redmine::ApiTest::VersionsTest < Redmine::ApiTest::Base
            :member_roles,
            :members,
            :enabled_modules,
-           :versions
+           :versions,
+           :wikis, :wiki_pages

   test "GET /projects/:project_id/versions.xml should return project versions" do
     get '/projects/1/versions.xml'

Associated revisions

Revision 18407
Added by Go MAEDA 22 days ago

Add missing fixtures to Redmine::ApiTest::VersionsTest (#31965).

Patch by Yuichi HARADA.

History

#1 Updated by Go MAEDA 22 days ago

  • Target version set to 4.1.0

#2 Updated by Go MAEDA 22 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the fix. Thank you.

Also available in: Atom PDF