Sha256: c53ab3edfadc060c01248a5ff620ec7f1f36e3f8223321165cc4f812fe70b14e

Contents?: true

Size: 593 Bytes

Versions: 32

Compression:

Stored size: 593 Bytes

Contents

require 'test_helper'

class PopularityTest < ActiveSupport::TestCase
  def setup
    @popularity_calculator = Lentil::PopularityCalculator.new
  end

  test "Given an image object a popularity score should be returned" do
      image = lentil_images(:one)
      popularity_score = @popularity_calculator.calculate_popularity(image)
      assert(popularity_score > 0)
  end

  test "Popularity score should be saved" do
      image = lentil_images(:one)
      @popularity_calculator.update_image_popularity_score(image.id)
      assert(Lentil::Image.find(image.id).popular_score > 0)
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
lentil-1.0.5 test/unit/lentil/popularity_test.rb
lentil-1.0.4 test/unit/lentil/popularity_test.rb
lentil-1.0.3 test/unit/lentil/popularity_test.rb
lentil-1.0.2 test/unit/lentil/popularity_test.rb
lentil-1.0.1 test/unit/lentil/popularity_test.rb
lentil-1.0.0 test/unit/lentil/popularity_test.rb
lentil-0.9.1 test/unit/lentil/popularity_test.rb
lentil-0.9.0 test/unit/lentil/popularity_test.rb
lentil-0.8.0 test/unit/lentil/popularity_test.rb
lentil-0.7.1 test/unit/lentil/popularity_test.rb
lentil-0.6.0 test/unit/lentil/popularity_test.rb
lentil-0.5.2 test/unit/lentil/popularity_test.rb
lentil-0.5.1 test/unit/lentil/popularity_test.rb
lentil-0.5.0 test/unit/lentil/popularity_test.rb
lentil-0.4.2 test/unit/lentil/popularity_test.rb
lentil-0.4.0 test/unit/lentil/popularity_test.rb
lentil-0.3.1 test/unit/lentil/popularity_test.rb
lentil-0.3.0 test/unit/lentil/popularity_test.rb
lentil-0.2.3 test/unit/lentil/popularity_test.rb
lentil-0.2.2 test/unit/lentil/popularity_test.rb