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

Extract JSONSharedTestCases #29175

Merged
merged 1 commit into from May 25, 2017
Merged

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented May 22, 2017

Both mysql2/json_test.rb and postgresql/json_test.rb have same test
cases.

Both `mysql2/json_test.rb` and `postgresql/json_test.rb` have same test
cases.
@matthewd
Copy link
Member

Perhaps we should pull this up as test/cases/json_test.rb, with the ActiveRecord::Base.connection.supports_json? condition to decide whether it runs for the current adapter? That feels like the more common pattern.

@kamipo
Copy link
Member Author

kamipo commented May 25, 2017

A reason that extracting JSONSharedTestCases is for sharing the test cases with Mysql2JSONTest, PostgresqlJSONTest, and PostgresqlJSONBTest.
And also, the result of connection.supports_json? is true for json, but not true for jsonb.
So I'd kept adapters/{mysql2,postgresql}/json_test.rb for now.

@matthewd
Copy link
Member

👍🏻 I'd forgotten about jsonb.

@matthewd matthewd merged commit 7424a17 into rails:master May 25, 2017
@kamipo kamipo deleted the extract_json_shared_tests branch May 25, 2017 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants