Sha256: a0e2ea7a5a88bf909d70841c3ae4709bed791a8b9832422de68cd152ae9295be

Contents?: true

Size: 1.24 KB

Versions: 23

Compression:

Stored size: 1.24 KB

Contents

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

module MeducationSDK
  class MediaFileTest < ResourceTest
    test_resource(MediaFile, '/media_files')

    def test_comments_calls_sdk
      media_file = MediaFile.new(id: 5)
      MeducationSDK::Comment.expects(:where).with(item_id: media_file.id, item_type: "MediaFile")
      media_file.comments
    end

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

    def test_mdia_file_responds_to_rating
      media_file = MediaFile.new(rating: 5)
      assert media_file.respond_to?(:rating)
    end

    def test_mdia_file_responds_to_rating
      media_file = MediaFile.new(rating: 5)
      assert media_file.respond_to?('rating')
    end

    def test_uploaded_state_is_correct
      assert_equal 1, MeducationSDK::MediaFile::State.uploaded
    end

    def test_processing_state_is_correct
      assert_equal 2, MeducationSDK::MediaFile::State.processing
    end

    def test_available_state_is_correct
      assert_equal 3, MeducationSDK::MediaFile::State.available
    end

    def test_redacted_state_is_correct
      assert_equal 4, MeducationSDK::MediaFile::State.redacted
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
meducation_sdk-2.0.2 test/resources/media_file_test.rb
meducation_sdk-2.0.1 test/resources/media_file_test.rb
meducation_sdk-2.0.0 test/resources/media_file_test.rb
meducation_sdk-1.6.16 test/resources/media_file_test.rb
meducation_sdk-1.6.15 test/resources/media_file_test.rb
meducation_sdk-1.6.14 test/resources/media_file_test.rb
meducation_sdk-1.6.13 test/resources/media_file_test.rb
meducation_sdk-1.6.12 test/resources/media_file_test.rb
meducation_sdk-1.6.11 test/resources/media_file_test.rb
meducation_sdk-1.6.10 test/resources/media_file_test.rb
meducation_sdk-1.6.6 test/resources/media_file_test.rb
meducation_sdk-1.6.5 test/resources/media_file_test.rb
meducation_sdk-1.6.4 test/resources/media_file_test.rb
meducation_sdk-1.6.3 test/resources/media_file_test.rb
meducation_sdk-1.6.2 test/resources/media_file_test.rb
meducation_sdk-1.6.1 test/resources/media_file_test.rb
meducation_sdk-1.6.0 test/resources/media_file_test.rb
meducation_sdk-1.5.7 test/resources/media_file_test.rb
meducation_sdk-1.5.6 test/resources/media_file_test.rb
meducation_sdk-1.5.5 test/resources/media_file_test.rb