Sha256: 24ba53cd924931557272a343edd0541f048c32ae78585d08f90005ab03e568f2

Contents?: true

Size: 517 Bytes

Versions: 11

Compression:

Stored size: 517 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe "Removing unused" do
  let(:article) { Article.create }

  it "deletes only unused tags" do
    pancakes = Gutentag::Tag.create :name => "pancakes"
    Gutentag::Tag.create :name => "waffles"

    Gutentag::Tagging.create :tag => pancakes, :taggable => article

    expect(Gutentag::Tag.pluck(:name)).to match_array(%w[ pancakes waffles ])

    Gutentag::RemoveUnused.call

    expect(Gutentag::Tag.pluck(:name)).to match_array(%w[ pancakes ])
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gutentag-2.5.2 spec/acceptance/removing_unused_spec.rb
gutentag-2.5.1 spec/acceptance/removing_unused_spec.rb
gutentag-2.5.0 spec/acceptance/removing_unused_spec.rb
gutentag-2.4.1 spec/acceptance/removing_unused_spec.rb
gutentag-2.4.0 spec/acceptance/removing_unused_spec.rb
gutentag-2.3.2 spec/acceptance/removing_unused_spec.rb
gutentag-2.3.1 spec/acceptance/removing_unused_spec.rb
gutentag-2.3.0 spec/acceptance/removing_unused_spec.rb
gutentag-2.2.1 spec/acceptance/removing_unused_spec.rb
gutentag-2.2.0 spec/acceptance/removing_unused_spec.rb
gutentag-2.1.0 spec/acceptance/removing_unused_spec.rb