Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match a expected value with message of assert_equal in AJ helper methods #19969

Merged
merged 1 commit into from
May 1, 2015
Merged

match a expected value with message of assert_equal in AJ helper methods #19969

merged 1 commit into from
May 1, 2015

Conversation

y-yagi
Copy link
Member

@y-yagi y-yagi commented Apr 30, 2015

In assert_equal calling in assert_enqueued_jobs and assert_performed_jobs, appoint the value that added original count and number to. However, appoint only number in error message.

Therefore, when call perform_later before calling assert_enqueued_jobs, output is different from Expected in error message.

test "sample1" do 
  GuestsCleanupJob.perform_later('guest 1')
  assert_enqueued_jobs 2 do
    GuestsCleanupJob.perform_later('guest 2')
  end
end
  1) Failure:
GuestsCleanupJobTest#test_test_1 [/home/yaginuma/program/rails/master/test/jobs/guests_cleanup_job_test.rb:6]:
2 jobs expected, but 1 were enqueued.
Expected: 3
  Actual: 2 

This patch fixes the argument of assert_equal, so it's output as follows.

  1) Failure:
GuestsCleanupJobTest#test_test_1 [/home/yaginuma/program/rails/master/test/jobs/guests_cleanup_job_test.rb:6]:
2 jobs expected, but 1 were enqueued.
Expected: 2
  Actual: 1

@senny senny merged commit 9150866 into rails:master May 1, 2015
senny added a commit that referenced this pull request May 1, 2015
match a expected value with message of `assert_equal` in AJ helper methods
@senny
Copy link
Member

senny commented May 1, 2015

@y-yagi good catch! 👍 I added a changelog entry and some test-cases in the merge commit 4d4950f

@y-yagi
Copy link
Member Author

y-yagi commented May 1, 2015

@senny Thanks!

@y-yagi y-yagi deleted the fix_job_helper_method branch May 1, 2015 07:09
senny added a commit that referenced this pull request May 1, 2015
match a expected value with message of `assert_equal` in AJ helper methods

Conflicts:
	activejob/CHANGELOG.md
	activejob/lib/active_job/test_helper.rb
@senny
Copy link
Member

senny commented May 1, 2015

Backported to 4-2-stable: b081eda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants