Sha256: ec5b73dc94369741b4a43b94087490fed9dbc61fcc857468b149522351bfe5f7

Contents?: true

Size: 909 Bytes

Versions: 8

Compression:

Stored size: 909 Bytes

Contents

# frozen_string_literal: true

require "rails_helper"

module Archangel
  module Liquid
    module Tags
      RSpec.describe TextDirectionTag, type: :liquid_tag,
                                       disable: :verify_partial_doubles do
        let(:context) { ::Liquid::Context.new({}, {}, view: view) }

        it "returns `ltr` text direction" do
          allow(view).to receive(:text_direction).and_return("ltr")

          result = ::Liquid::Template.parse("{% text_direction %}")
                                     .render(context)

          expect(result).to eq("ltr")
        end

        it "returns `rtl` text direction" do
          allow(view).to receive(:text_direction).and_return("rtl")

          result = ::Liquid::Template.parse("{% text_direction %}")
                                     .render(context)

          expect(result).to eq("rtl")
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
archangel-0.3.0 spec/lib/archangel/liquid/tags/text_direction_tag_spec.rb
archangel-0.0.8 spec/lib/archangel/liquid/tags/text_direction_tag_spec.rb
archangel-0.0.7 spec/lib/archangel/liquid/tags/text_direction_tag_spec.rb
archangel-0.0.6 spec/lib/archangel/liquid/tags/text_direction_tag_spec.rb
archangel-0.0.5 spec/lib/archangel/liquid/tags/text_direction_tag_spec.rb
archangel-0.0.4 spec/lib/archangel/liquid/tags/text_direction_tag_spec.rb
archangel-0.0.3 spec/lib/archangel/liquid/tags/text_direction_tag_spec.rb
archangel-0.0.2 spec/lib/archangel/liquid/tags/text_direction_tag_spec.rb