Sha256: 1c52c5997fdcb4dd7698cd8cf6338c761823e7e51c1a366fadf5c8c87c7aa770

Contents?: true

Size: 1.48 KB

Versions: 5

Compression:

Stored size: 1.48 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

5 entries across 5 versions & 1 rubygems

Version Path
sharing_tags-0.0.9 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.8 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.7 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.6 spec/helpers/meta_tags_helper_spec.rb
sharing_tags-0.0.5 spec/helpers/meta_tags_helper_spec.rb