Only execute the JsonVersion tests against ActiveRecord4 since there is no ActiveRecord3 support for it
This commit is contained in:
parent
46f1709ab3
commit
916b78897b
|
@ -1,11 +1,12 @@
|
||||||
require 'rails_helper'
|
if JsonVersion.table_exists?
|
||||||
|
|
||||||
describe JsonVersion, :type => :model do
|
require 'rails_helper'
|
||||||
it "should include the `VersionConcern` module to get base functionality" do
|
|
||||||
expect(JsonVersion).to include(PaperTrail::VersionConcern)
|
describe JsonVersion, :type => :model do
|
||||||
end
|
it "should include the `VersionConcern` module to get base functionality" do
|
||||||
|
expect(JsonVersion).to include(PaperTrail::VersionConcern)
|
||||||
|
end
|
||||||
|
|
||||||
if ENV['DB'] == 'postgres' || JsonVersion.table_exists?
|
|
||||||
describe "Methods" do
|
describe "Methods" do
|
||||||
describe "Class" do
|
describe "Class" do
|
||||||
|
|
||||||
|
@ -71,8 +72,9 @@ describe JsonVersion, :type => :model do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -60,7 +60,7 @@ class SetUpTestTables < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
add_index :post_versions, [:item_type, :item_id]
|
add_index :post_versions, [:item_type, :item_id]
|
||||||
|
|
||||||
if ENV['DB'] == 'postgres'
|
if ENV['DB'] == 'postgres' && ::ActiveRecord::VERSION::MAJOR >= 4
|
||||||
create_table :json_versions, :force => true do |t|
|
create_table :json_versions, :force => true do |t|
|
||||||
t.string :item_type, :null => false
|
t.string :item_type, :null => false
|
||||||
t.integer :item_id, :null => false
|
t.integer :item_id, :null => false
|
||||||
|
|
Loading…
Reference in New Issue