Sha256: d7ef5e6e256b7f308ff14173f4db046a45e57eaa5b79b84c3b36ecafe9a2a6c0

Contents?: true

Size: 810 Bytes

Versions: 34

Compression:

Stored size: 810 Bytes

Contents

require_relative '../../test_helper'
require_relative '../../resource_test'

module MeducationSDK
  class Badges::BadgeTest < ResourceTest

    def self.test_badge(klass)
      define_method :klass do klass end

      class_eval do
        def test_issue_or_update_progress_calls_loquor
          user_id = 12
          url = "#{klass.path}/issue_or_update_progress"
          Loquor.expects(:put).with(url, user_id: user_id)
          klass.issue_or_update_progress(user_id)
        end

        def test_user_calls_sdk
          badge = klass.new(user_id: 3)
          MeducationSDK::User.expects(:find).with(3)
          badge.user
        end

        def test_ruby_gets_called
          return unless ENV["INTEGRATION"]
          klass.issue_or_update_progress(2)
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
meducation_sdk-2.2.2 test/resources/badges/badge_test.rb
meducation_sdk-2.2.1 test/resources/badges/badge_test.rb
meducation_sdk-2.2.0 test/resources/badges/badge_test.rb
meducation_sdk-2.1.4 test/resources/badges/badge_test.rb
meducation_sdk-2.1.3 test/resources/badges/badge_test.rb
meducation_sdk-2.1.2 test/resources/badges/badge_test.rb
meducation_sdk-2.1.1 test/resources/badges/badge_test.rb
meducation_sdk-2.1.0 test/resources/badges/badge_test.rb
meducation_sdk-2.0.5 test/resources/badges/badge_test.rb
meducation_sdk-2.0.4 test/resources/badges/badge_test.rb
meducation_sdk-2.0.3 test/resources/badges/badge_test.rb
meducation_sdk-2.0.2 test/resources/badges/badge_test.rb
meducation_sdk-2.0.1 test/resources/badges/badge_test.rb
meducation_sdk-2.0.0 test/resources/badges/badge_test.rb
meducation_sdk-1.6.16 test/resources/badges/badge_test.rb
meducation_sdk-1.6.15 test/resources/badges/badge_test.rb
meducation_sdk-1.6.14 test/resources/badges/badge_test.rb
meducation_sdk-1.6.13 test/resources/badges/badge_test.rb
meducation_sdk-1.6.12 test/resources/badges/badge_test.rb
meducation_sdk-1.6.11 test/resources/badges/badge_test.rb