Sha256: 4d19405911aa5879849e75e184070dec5f4e49bb61e60eb6fd90a46f8d2e555e

Contents?: true

Size: 894 Bytes

Versions: 62

Compression:

Stored size: 894 Bytes

Contents

require 'test_helper'

module Workarea
  class User
    class AdminVisitTest < TestCase
      def test_most_visited
        create_admin_visit(name: 'Baz', path: '/baz', user_id: 1)
        create_admin_visit(name: 'Foo', path: '/foo', user_id: 2)
        create_admin_visit(name: 'Baz', path: '/baz', user_id: 1)
        create_admin_visit(name: 'Baz', path: '/baz', user_id: 1)
        create_admin_visit(name: 'Bar', path: '/bar', user_id: 1)
        create_admin_visit(name: 'Bar', path: '/bar', user_id: 1)
        create_admin_visit(name: 'Foo', path: '/foo', user_id: 1)

        results = AdminVisit.most_visited(1)
        assert_equal(3, results.length)
        assert_equal({ name: 'Baz', path: '/baz' }, results.first)
        assert_equal({ name: 'Bar', path: '/bar' }, results.second)
        assert_equal({ name: 'Foo', path: '/foo' }, results.third)
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.5.26 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.4.45 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.5.25 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.5.23 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.4.44 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.5.22 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.4.43 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.5.21 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.4.42 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.5.20 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.4.41 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.5.19 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.4.40 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.5.18 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.4.39 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.5.17 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.4.38 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.5.16 test/models/workarea/user/admin_visit_test.rb
workarea-core-3.4.37 test/models/workarea/user/admin_visit_test.rb