Sha256: fe9a1368130500a724da5e0ff83a62fbf5ceced794d272d7995e96ba8ba38bb5
Contents?: true
Size: 1.18 KB
Versions: 5
Compression:
Stored size: 1.18 KB
Contents
require_relative '../../../../test_helper' module Troo module Remote module Persistence describe Comment do let(:described_class) { Comment } let(:external_card_id) { '20020' } let(:text) { 'Some much needed feedback...' } let(:comment) { [Fabricate.build(:comment, text: text)] } before do Troo::Persistence::Local.stubs(:with_collection) .returns(comment) end after { database_cleanup } describe '.with' do before do VCR.insert_cassette(:create_comment, decode_compressed_response: true) end after { VCR.eject_cassette } subject { described_class.with(external_card_id, text) } context 'when the comment was created' do it 'returns the new comment' do subject.must_be_instance_of Troo::Comment end end context 'when the comment was not created' do before { API::Client.stubs(:perform).returns([]) } it { subject.must_equal false } end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems