Defect #33787

Redmine::ApiTest::UsersTest fail if config.time_zone is set

Added by Yuichi HARADA over 2 years ago. Updated about 2 years ago.

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


Category:REST API
Target version:-
Resolution:Fixed Affected version:


If you set config.time_zone to a value other than UTC, the test will fail.

Set config.time_zone in config/additional_environment.rb.

config.time_zone = 'Tokyo'

Run the test.

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

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

# Running:


Redmine::ApiTest::UsersTest#test_GET_/users/:id.xml_should_return_the_user [test/integration/api_test/users_test.rb:69]:
<2006-07-19T20:42:15Z> expected but was
Expected 0 to be >= 1.

bin/rails test test/integration/api_test/users_test.rb:64


Redmine::ApiTest::UsersTest#test_GET_/users/:id.json_should_return_the_user [test/integration/api_test/users_test.rb:81]:
Expected: "2006-07-19T20:42:15Z" 
  Actual: "2006-07-20T05:42:15+09:00" 

bin/rails test test/integration/api_test/users_test.rb:73


Finished in 1.581580s, 16.4393 runs/s, 91.6805 assertions/s.
26 runs, 145 assertions, 2 failures, 0 errors, 0 skips

33787-apitest-failed.patch Magnifier (1013 Bytes) Yuichi HARADA, 2020-07-30 07:35

Related issues

Related to Redmine - Feature #33592: Include updated_on and passwd_changed_on columns in users... Closed

Associated revisions

Revision 19942
Added by Go MAEDA over 2 years ago

Redmine::ApiTest::UsersTest fails if config.time_zone is set (#33592, #33787).

Patch by Yuichi HARADA.


#1 Updated by Yuichi HARADA over 2 years ago

I have fixed the API tests. It does not depend on the UTC time zone.

#2 Updated by Mizuki ISHIKAWA over 2 years ago

This is a fix for the test added in #33592.

#3 Updated by vzvu 3k6k over 2 years ago

Thank you for fixing the tests. It looks good to me.

#4 Updated by Go MAEDA over 2 years ago

  • Related to Feature #33592: Include updated_on and passwd_changed_on columns in users API response added

#5 Updated by Go MAEDA over 2 years ago

  • Category set to REST API
  • Status changed from New to Closed
  • Resolution set to Fixed

Committed the patch as a part of #33592. Thank you.

#6 Updated by Go MAEDA about 2 years ago

  • Assignee set to Go MAEDA

Also available in: Atom PDF