Sha256: 0c437797a5b45d18bc0f7d6a26b93ce7d76d3c60f9a62f53a3517834a3c821e6

Contents?: true

Size: 758 Bytes

Versions: 6

Compression:

Stored size: 758 Bytes

Contents

RSpec.configure do |config|
  config.before do
    # Clear class state before each spec.
    Object.send(:remove_const, "Post")
    Object.send(:remove_const, "SubPost")
    load "app/post.rb"

    # Known state.
    I18n.default_locale = :sv
  end
end

# Test against real ActiveRecord models.
# Very much based on the test setup in
# https://github.com/iain/translatable_columns/

require "active_record"
require "app/post.rb"

ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"

ActiveRecord::Schema.define(version: 0) do
  create_table :posts, force: true do |t|
    t.string :title_sv, :title_en, :title_pt_br, :title_de
    t.string :body_sv, :body_en, :body_pt_br, :body_de
  end
end

I18n.load_path << "spec/app/sv.yml"

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
traco-5.3.3 spec/spec_helper_models.rb
traco-5.3.2 spec/spec_helper_models.rb
traco-5.3.1 spec/spec_helper_models.rb
traco-5.3.0 spec/spec_helper_models.rb
traco-5.2.0 spec/spec_helper_models.rb
traco-5.1.0 spec/spec_helper_models.rb