Sha256: 56988012aa1db9386bde11c6808a25bb3a337e82394d6da7be9ee01929b7dc5b

Contents?: true

Size: 1.46 KB

Versions: 6

Compression:

Stored size: 1.46 KB

Contents

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

  describe "#sharing_tags" do
    pending
  end

  describe "#sharing_meta_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.sharing_meta_tags).to have_tag "meta", with: {property: "og:title", content: "Sharing title"}
      expect(helper.sharing_meta_tags).to have_tag "meta", with: {property: "og:description", content: "Sharing description"}
      expect(helper.sharing_meta_tags).to have_tag "meta", with: {property: "og:image", content: "http://img.png"}
    end

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sharing_tags-0.0.18 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.17 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.16 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.15 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.14 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.13 spec/helpers/meta_tags_helper_spec.rb