Sha256: 1cc8765c98cca25c56454ec6e1a9a189df7635034923befe5577f462f8180268

Contents?: true

Size: 576 Bytes

Versions: 9

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Spree::ReviewsHelper do
  context 'star' do
    specify do
      expect(star('a_class')).to eq '<span class="a_class"> &#10030; </span>'
    end
  end

  context 'mk_stars' do
    specify do
      matches = mk_stars(2).scan(/unlit/)
      expect(matches.length).to eq 3
    end
  end

  context 'txt_stars' do
    specify do
      expect(txt_stars(2, true)).to eq '2 out of 5'
    end

    specify do
      expect(txt_stars(3, false)).to be_a String
      expect(txt_stars(3, false)).to eq('3')
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
solidus_reviews-1.7.0 spec/helpers/review_helper_spec.rb
solidus_reviews-1.6.0 spec/helpers/review_helper_spec.rb
solidus_reviews-1.5.0 spec/helpers/review_helper_spec.rb
solidus_reviews-1.4.1 spec/helpers/review_helper_spec.rb
solidus_reviews-1.4.0 spec/helpers/review_helper_spec.rb
solidus_reviews-1.3.0 spec/helpers/review_helper_spec.rb
solidus_reviews-1.2.0 spec/helpers/review_helper_spec.rb
solidus_reviews-1.1.1 spec/helpers/review_helper_spec.rb
solidus_reviews-1.1.0 spec/helpers/review_helper_spec.rb