merged/test/models/card_write_test.rb

31 lines
602 B
Ruby
Raw Normal View History

require "git"
require "test_helper"
module Merged
class CardWriteTest < ActiveSupport::TestCase
include CardHelper
include Cleanup
def test_deletes
id = first.id
first.delete_save!
assert_raises(ActiveHash::RecordNotFound) {Card.find(id) }
end
2023-01-05 20:34:14 +01:00
def test_delete_index
section = first.section
index = first.index
first.delete_and_reset_index
assert_equal index , section.cards.second.index
end
def test_adds
card = Card.first.section.new_card
card.add_save!
assert_equal "NEW" , card.header
end
end
end