Sha256: e2306dd70d8d1dc6540a30a770453716fdc4f2cb1090e0cf2d9183ba527ae207

Contents?: true

Size: 747 Bytes

Versions: 7

Compression:

Stored size: 747 Bytes

Contents

# frozen_string_literal: true

require "rails_helper"

module Archangel
  module Liquid
    module Tags
      RSpec.describe ThemeJavascriptTag, type: :liquid_tag,
                                         disable: :verify_partial_doubles do
        let(:site) { create(:site) }
        let(:context) do
          ::Liquid::Context.new({ "site" => site }, {}, view: view)
        end

        it "renders Javascript tag for theme" do
          allow(view).to receive(:current_theme).and_return("default")

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

          expect(result).to include('<script src="/assets/default/frontend')
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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