Sha256: ad2fa06aa5816852fe9bd683293843e420e578b9ecd4504570e8d417b2e72322

Contents?: true

Size: 1.02 KB

Versions: 27

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'
require 'flapjack/data/tag'

describe Flapjack::Data::Tag, :redis => true do

  it "adds references to tags" do
    tags = Flapjack::Data::Tag.create('special', ['apple', 'button', 'carbon'], :redis => @redis)

    expect(tags).to include('carbon')
    expect(tags).not_to include('chocolate')

    tags.add('chocolate')
    expect(tags).to include('chocolate')
  end

  it "deletes references from tags" do
    tags = Flapjack::Data::Tag.create('special', ['apple', 'button', 'carbon'], :redis => @redis)

    expect(tags).to include('apple')
    expect(tags).to include('button')

    tags.delete('button')
    expect(tags).to include('apple')
    expect(tags).not_to include('button')
  end

  it "lists references contained in a tag" do
    t1 = Flapjack::Data::Tag.create('special', ['apple', 'button', 'carbon'], :redis => @redis)

    t2 = Flapjack::Data::Tag.find('special', :redis => @redis)
    expect(t2).to include('apple')
    expect(t2).to include('carbon')
    expect(t2).not_to include('chocolate')
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
flapjack-0.9.6 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.9.5 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.9.4 spec/lib/flapjack/data/tag_spec.rb
flapjack-1.1.0 spec/lib/flapjack/data/tag_spec.rb
flapjack-1.0.0 spec/lib/flapjack/data/tag_spec.rb
flapjack-1.0.0rc6 spec/lib/flapjack/data/tag_spec.rb
flapjack-1.0.0rc5 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.9.3 spec/lib/flapjack/data/tag_spec.rb
flapjack-1.0.0rc3 spec/lib/flapjack/data/tag_spec.rb
flapjack-1.0.0rc2 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.9.2 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.9.1 spec/lib/flapjack/data/tag_spec.rb
flapjack-1.0.0rc1 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.9.0 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.12 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.11 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.10 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.9 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.8 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.7 spec/lib/flapjack/data/tag_spec.rb