Sha256: 2344a1580c118bc3a96da7d0de9dd4253b25a2ac692e23e4bb3f0b5372bad829

Contents?: true

Size: 980 Bytes

Versions: 13

Compression:

Stored size: 980 Bytes

Contents

require 'spec_helper'

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

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

    tags.should include('carbon')
    tags.should_not include('chocolate')

    tags.add('chocolate')
    tags.should include('chocolate')
  end

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

    tags.should include('apple')
    tags.should include('button')

    tags.delete('button')
    tags.should include('apple')
    tags.should_not 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)
    t2.should include('apple')
    t2.should include('carbon')
    t2.should_not include('chocolate')
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
flapjack-0.7.35 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.34 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.33 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.32 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.31 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.30 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.29 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.28 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.27 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.26 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.25 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.22 spec/lib/flapjack/data/tag_spec.rb
flapjack-0.7.21 spec/lib/flapjack/data/tag_spec.rb