Sha256: 7acc057f731d525dddb4eb1e20921f8213786400b509872aa5638534365d057e

Contents?: true

Size: 456 Bytes

Versions: 7

Compression:

Stored size: 456 Bytes

Contents

require 'spec_helper'

module Ransack
  describe Translate do

    describe '.attribute' do
      it 'translate namespaced attribute like AR does' do
        ar_translation = ::Namespace::Article.human_attribute_name(:title)
        ransack_translation = Ransack::Translate.attribute(
          :title,
          context: ::Namespace::Article.ransack.context
          )
        expect(ransack_translation).to eq ar_translation
      end
    end
  end
end

Version data entries

7 entries across 6 versions & 2 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/ransack-4.2.1/spec/ransack/translate_spec.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/ransack-4.2.1/spec/ransack/translate_spec.rb
ransack-4.2.1 spec/ransack/translate_spec.rb
ransack-4.2.0 spec/ransack/translate_spec.rb
ransack-4.1.1 spec/ransack/translate_spec.rb
ransack-4.1.0 spec/ransack/translate_spec.rb
ransack-4.0.0 spec/ransack/translate_spec.rb