Sha256: 044c381c1a32154e1c213547bbb3223f73221d06d73c0a690779d652cae05f26

Contents?: true

Size: 426 Bytes

Versions: 3

Compression:

Stored size: 426 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.search.context)
        expect(ransack_translation).to eq ar_translation
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ransack-1.4.1 spec/ransack/translate_spec.rb
ransack-1.4.0 spec/ransack/translate_spec.rb
ransack-1.3.0 spec/ransack/translate_spec.rb