Sha256: 617637863b9273152122a03d9b0d8a8c428e36b4fd6ced48739d37c849f0ebc7
Contents?: true
Size: 1005 Bytes
Versions: 9
Compression:
Stored size: 1005 Bytes
Contents
# frozen_string_literal: true require "rails_helper" RSpec.describe Cmor::Seo::GenerateMetaTagsService do it { expect(described_class.new).to be_a(Cmor::Seo::GenerateMetaTagsService) } context "basic usage" do let(:resources) { [create_list(:post, 3), create_list(:page, 3)].flatten } let(:attributes) { { resources: resources, default_url_options: "https://localhost:3000" } } let(:options) { {} } subject { described_class.new(attributes, options) } describe "result" do subject { described_class.call(attributes, options) } it { expect(subject).to be_ok } it { expect(subject.meta_tags.map(&:new_record?).uniq).to eq([true]) } it { expect(subject.meta_tags.size).to eq(15) } end describe "autosave" do let(:options) { { autosave: true } } subject { described_class.call(attributes, options) } it { expect(subject).to be_ok } it { expect(subject.meta_tags.map(&:persisted?).uniq).to eq([true]) } end end end
Version data entries
9 entries across 9 versions & 1 rubygems