Sha256: a6c99c9ea01ec29cb9ecb30d24b0e36e0958c0a25802713603f3c14711c1c309
Contents?: true
Size: 1.01 KB
Versions: 8
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true require "rails_helper" module Archangel module Liquid module Tags RSpec.describe CsrfMetaTagsTag, type: :liquid_tag, disable: :verify_partial_doubles do let(:context) { ::Liquid::Context.new({}, {}, view: view) } it "returns CSRF meta tags" do allow(view).to receive(:protect_against_forgery?).and_return(true) allow(view).to( receive(:form_authenticity_token) .and_return("rails_form_authenticity_token") ) result = ::Liquid::Template.parse("{% csrf_meta_tags %}") .render(context) expected_param = '<meta name="csrf-param" content="authenticity_token" />' expected_token = '<meta name="csrf-token" content="rails_form_authenticity_token" />' expect(result).to include(expected_param) expect(result).to include(expected_token) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems