Sha256: 86b917b7b9ce6a513bc075eaafaf659bc26f7fe18d942e50ffd4ca7e6b435e95

Contents?: true

Size: 907 Bytes

Versions: 28

Compression:

Stored size: 907 Bytes

Contents

require 'test_helper'

class CommentsTest < Totter::TestCase
  def test_comments
    VCR.use_cassette 'comments/index' do
      comments = local_client.comments(1, 19)
      assert_equal Array, comments.class
      assert_equal 'More cheese!', comments[0].message
    end
  end

  def test_creating_comment
    VCR.use_cassette 'comments/create' do
      message = "I'd like to buy a vowel."
      comment = local_client.create_comment(1, 19, message)
      assert_equal message, comment.message
    end
  end

  def test_destroying_comment
    VCR.use_cassette 'comments/destroy' do
      previous_length = local_client.comments(1, 19).length
      comment = local_client.create_comment(1, 19, "Going to be deleted")
      assert local_client.destroy_comment(1, 19, comment.id)
      current_length = local_client.comments(1, 19).length
      assert_equal previous_length, current_length
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
totter-0.4.8 test/totter/client/comments_test.rb
totter-0.4.7 test/totter/client/comments_test.rb
totter-0.4.6 test/totter/client/comments_test.rb
totter-0.4.5 test/totter/client/comments_test.rb
totter-0.4.4 test/totter/client/comments_test.rb
totter-0.4.3 test/totter/client/comments_test.rb
totter-0.4.2 test/totter/client/comments_test.rb
totter-0.4.1 test/totter/client/comments_test.rb
totter-0.4.0 test/totter/client/comments_test.rb
totter-0.3.9 test/totter/client/comments_test.rb
totter-0.3.8 test/totter/client/comments_test.rb
totter-0.3.7 test/totter/client/comments_test.rb
totter-0.3.6 test/totter/client/comments_test.rb
totter-0.3.5 test/totter/client/comments_test.rb
totter-0.3.4 test/totter/client/comments_test.rb
totter-0.3.3 test/totter/client/comments_test.rb
totter-0.3.2 test/totter/client/comments_test.rb
totter-0.3.1 test/totter/client/comments_test.rb
totter-0.3.0 test/totter/client/comments_test.rb
totter-0.2.14 test/totter/client/comments_test.rb