Sha256: 4fa23eb3543b89c3791bc6800970d3204f5927c2325ed219b9f2ca64aa0417a1

Contents?: true

Size: 1.47 KB

Versions: 3

Compression:

Stored size: 1.47 KB

Contents

RSpec.describe SharingTags::ActionView::MetaHelper, type: :helper do

  describe "#sharing_tags" do
    pending
  end

  describe "#render_sharing_tags" do
    before do
      SharingTags.configure do
        title        "Sharing title"
        description  "Sharing description"
        page_url     "http://a.b"
        image        "http://img.png"
      end
    end

    it "generate open graph meta tags" do
      expect(helper.render_sharing_tags).to have_tag "meta", with: {property: "og:title", content: "Sharing title"}
      expect(helper.render_sharing_tags).to have_tag "meta", with: {property: "og:description", content: "Sharing description"}
      expect(helper.render_sharing_tags).to have_tag "meta", with: {property: "og:image", content: "http://img.png"}
    end

    it "generate schema meta tags" do
      expect(helper.render_sharing_tags).to have_tag "meta", with: {itemprop: "name",        content: "Sharing title"}
      expect(helper.render_sharing_tags).to have_tag "meta", with: {itemprop: "description", content: "Sharing description"}
      expect(helper.render_sharing_tags).to have_tag "meta", with: {itemprop: "image",       content: "http://img.png"}
    end

    it "generate twitter card meta tags" do
      expect(helper.render_sharing_tags).to have_tag "meta", with: {name: "twitter:title",       content: "Sharing title"}
      expect(helper.render_sharing_tags).to have_tag "meta", with: {name: "twitter:description", content: "Sharing description"}
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sharing_tags-0.0.12 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.11 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.10 spec/helpers/meta_tags_helper_spec.rb