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-1.6.5 test/resources/blog_post_test.rb
meducation_sdk-1.6.4 test/resources/blog_post_test.rb
meducation_sdk-1.6.3 test/resources/blog_post_test.rb
meducation_sdk-1.6.2 test/resources/blog_post_test.rb
meducation_sdk-1.6.1 test/resources/blog_post_test.rb
meducation_sdk-1.6.0 test/resources/blog_post_test.rb
meducation_sdk-1.5.7 test/resources/blog_post_test.rb
meducation_sdk-1.5.6 test/resources/blog_post_test.rb