Project

General

Profile

Actions

Patch #31965

closed

Add missing fixtures to Redmine::ApiTest::VersionsTest

Added by Yuichi HARADA over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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'
Actions

Also available in: Atom PDF