Sha256: 536088f166eceb5e84d0d7d845aea26e6a90f98be524dfe1d7e9d0d0f8e09596

Contents?: true

Size: 764 Bytes

Versions: 2

Compression:

Stored size: 764 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class EltTest < Test::Unit::TestCase
  fixtures :people, :users, :elts, :mails, :attachments, :subscribers

  def setup
    @elt = Elt.find(1)
  end

  def test_generated_id
		e = @elt.children.new
		e.subject = "\"Test: /de, ..  -\ #?&subject!\""
		e.body = "Test de body"
		e.save
		@elt.add_child e

		assert_equal "Test_de_subject", e.id

		e = @elt.children.new
		e.subject = "Test&? de subject"
		e.body = "Test de body"
		e.save
		@elt.add_child e

		assert_equal "Test_de_subject_1", e.id
  end

  def test_vote_hidden_from_view
		vote = @elt.children.new
		vote.save
		@elt.add_child vote
		vote.body = "+1"
		vote.publish

		assert_equal -1, vote.result
		assert_equal 1, vote.parent.result
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
parlement-0.7 test/unit/elt_test.rb
parlement-0.8 test/unit/elt_test.rb