2022-12-23 14:40:05 +02:00
|
|
|
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")
|
2022-12-23 14:40:05 +02:00
|
|
|
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")
|
2023-01-05 21:50:56 +02:00
|
|
|
assert_equal index , section.cards.first.index
|
2023-01-05 21:34:14 +02:00
|
|
|
end
|
|
|
|
|
2022-12-26 18:09:31 +02:00
|
|
|
def test_adds
|
|
|
|
card = Card.first.section.new_card
|
2023-01-06 18:50:06 +02:00
|
|
|
card.add_save!("me me")
|
2022-12-26 18:09:31 +02:00
|
|
|
assert_equal "NEW" , card.header
|
2022-12-23 14:40:05 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|