Sha256: 817dd70bd7eca87f9ccf91ffd4ae864ed062fb9d79e3306b93211d108eaa6e85

Contents?: true

Size: 694 Bytes

Versions: 28

Compression:

Stored size: 694 Bytes

Contents

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

module MeducationSDK
  class BlogPostTest < ResourceTest
    test_resource(BlogPost, '/blog_posts')

    def test_user_calls_sdk
      blog_post = BlogPost.new(user_id: 5)
      MeducationSDK::User.expects(:find).with(5)
      blog_post.user
    end

    def test_blogger_calls_sdk
      blog_post = BlogPost.new(blogger_id: 8)
      MeducationSDK::Blogger.expects(:find).with(8)
      blog_post.blogger
    end

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

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
meducation_sdk-2.2.0 test/resources/blog_post_test.rb
meducation_sdk-2.1.4 test/resources/blog_post_test.rb
meducation_sdk-2.1.3 test/resources/blog_post_test.rb
meducation_sdk-2.1.2 test/resources/blog_post_test.rb
meducation_sdk-2.1.1 test/resources/blog_post_test.rb
meducation_sdk-2.1.0 test/resources/blog_post_test.rb
meducation_sdk-2.0.5 test/resources/blog_post_test.rb
meducation_sdk-2.0.4 test/resources/blog_post_test.rb
meducation_sdk-2.0.3 test/resources/blog_post_test.rb
meducation_sdk-2.0.2 test/resources/blog_post_test.rb
meducation_sdk-2.0.1 test/resources/blog_post_test.rb
meducation_sdk-2.0.0 test/resources/blog_post_test.rb
meducation_sdk-1.6.16 test/resources/blog_post_test.rb
meducation_sdk-1.6.15 test/resources/blog_post_test.rb
meducation_sdk-1.6.14 test/resources/blog_post_test.rb
meducation_sdk-1.6.13 test/resources/blog_post_test.rb
meducation_sdk-1.6.12 test/resources/blog_post_test.rb
meducation_sdk-1.6.11 test/resources/blog_post_test.rb
meducation_sdk-1.6.10 test/resources/blog_post_test.rb
meducation_sdk-1.6.6 test/resources/blog_post_test.rb