merged/test/models/card_write_test.rb

30 lines
625 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
2023-01-06 18:50:06 +02:00
first.delete_save!("random")
assert_raises(ActiveHash::RecordNotFound) {Card.find(id) }
end
2023-01-05 21:34:14 +02:00
def test_delete_index
section = first.section
index = first.index
2023-01-06 18:50:06 +02:00
first.delete_and_reset_index("me")
assert_equal index , section.cards.first.index
2023-01-05 21:34:14 +02:00
end
def test_adds
card = Card.first.section.new_card
2023-01-06 18:50:06 +02:00
card.add_save!("me me")
assert_equal "NEW" , card.header
end
end
end