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.8.6 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.5 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.4 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.3 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.2 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.1 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.8.0 spec/lib/flapjack/data/tag_spec.rb