Sha256: d7dcf92bb196f06d4bd769954bedc5e377105b6a8e2f9e39ad71bd8bb438ee97

Contents?: true

Size: 1.15 KB

Versions: 6

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe Mingle::Hashtag do

  describe '#tag_name_with_hash' do
    context 'when the tag name already is prepended with a hash' do
      subject { build_stubbed :mingle_hashtag, tag_name: '#klhd' }

      it 'returns the tag name' do
        expect(subject.tag_name_with_hash).to eq "#klhd"
      end
    end

    context 'when the tag name is not prepended with a hash' do
      subject { build_stubbed :mingle_hashtag, tag_name: 'klhd' }

      it 'returns the tag name prepepded with a hash' do
        expect(subject.tag_name_with_hash).to eq "#klhd"
      end
    end
  end

  describe '#tag_name_without_hash' do
    context 'when the tag name already is prepended with a hash' do
      subject { build_stubbed :mingle_hashtag, tag_name: '#klhd' }

      it 'returns the tag name without the prefixed hash' do
        expect(subject.tag_name_without_hash).to eq "klhd"
      end
    end

    context 'when the tag name is not prepended with a hash' do
      subject { build_stubbed :mingle_hashtag, tag_name: 'klhd' }

      it 'returns the tag name' do
        expect(subject.tag_name_without_hash).to eq "klhd"
      end
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mingle-0.4.0 spec/models/mingle/hashtag_spec.rb
mingle-0.3.1 spec/models/mingle/hashtag_spec.rb
mingle-0.3.0 spec/models/mingle/hashtag_spec.rb
mingle-0.2.0 spec/models/mingle/hashtag_spec.rb
mingle-0.1.1 spec/models/mingle/hashtag_spec.rb
mingle-0.1 spec/models/mingle/hashtag_spec.rb