mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Execute JsonAttributeTest
only if supports_json?
returns true
Oracle enhanced adapter does not fully support JSON datatype then `supports_json?` returns `false`. I wanted to skip known failures and errors when tested with Oracle enhanced adapter.
This commit is contained in:
parent
7efb4d23c1
commit
29d081c47a
1 changed files with 27 additions and 25 deletions
|
@ -3,33 +3,35 @@
|
|||
require "cases/helper"
|
||||
require "cases/json_shared_test_cases"
|
||||
|
||||
class JsonAttributeTest < ActiveRecord::TestCase
|
||||
include JSONSharedTestCases
|
||||
self.use_transactional_tests = false
|
||||
if ActiveRecord::Base.connection.supports_json?
|
||||
class JsonAttributeTest < ActiveRecord::TestCase
|
||||
include JSONSharedTestCases
|
||||
self.use_transactional_tests = false
|
||||
|
||||
class JsonDataTypeOnText < ActiveRecord::Base
|
||||
self.table_name = "json_data_type"
|
||||
class JsonDataTypeOnText < ActiveRecord::Base
|
||||
self.table_name = "json_data_type"
|
||||
|
||||
attribute :payload, :json
|
||||
attribute :settings, :json
|
||||
attribute :payload, :json
|
||||
attribute :settings, :json
|
||||
|
||||
store_accessor :settings, :resolution
|
||||
store_accessor :settings, :resolution
|
||||
end
|
||||
|
||||
def setup
|
||||
super
|
||||
@connection.create_table("json_data_type") do |t|
|
||||
t.text "payload"
|
||||
t.text "settings"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def column_type
|
||||
:text
|
||||
end
|
||||
|
||||
def klass
|
||||
JsonDataTypeOnText
|
||||
end
|
||||
end
|
||||
|
||||
def setup
|
||||
super
|
||||
@connection.create_table("json_data_type") do |t|
|
||||
t.text "payload"
|
||||
t.text "settings"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def column_type
|
||||
:text
|
||||
end
|
||||
|
||||
def klass
|
||||
JsonDataTypeOnText
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue