Sha256: b3de6394e8cfcbd3a1b0002e5d5b16ed983666556d55e172430a362575f3b2c0

Contents?: true

Size: 593 Bytes

Versions: 7

Compression:

Stored size: 593 Bytes

Contents

require 'spec_helper'

describe ActsAsTaggableArrayOn::Parser do
  let(:parser) { ActsAsTaggableArrayOn.parser }

  describe '#parse' do
    it "return unprocessed tags if array" do
      tags = %w(red green)
      expect(parser.parse(tags)).to eq tags
    end

    it "return parsed tags if comma separated string" do
      tags = 'red,green'
      expect(parser.parse(tags)).to eq %w(red green)
    end

    it "return parsed tags if comma separated string including white spaces" do
      tags = 'red   , gre  en'
      expect(parser.parse(tags)).to eq ['red', 'gre  en']
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
acts-as-taggable-array-on-0.6.0 spec/acts_as_tag_pgarray/parser_spec.rb
acts-as-taggable-array-on-0.5.1 spec/acts_as_tag_pgarray/parser_spec.rb
acts-as-taggable-array-on-0.5 spec/acts_as_tag_pgarray/parser_spec.rb
acts-as-taggable-array-on-0.4.2 spec/acts_as_tag_pgarray/parser_spec.rb
acts-as-taggable-array-on-0.4.1 spec/acts_as_tag_pgarray/parser_spec.rb
acts-as-taggable-array-on-0.4.0 spec/acts_as_tag_pgarray/parser_spec.rb
acts-as-taggable-array-on-0.3.0 spec/acts_as_tag_pgarray/parser_spec.rb