Sha256: ef4faccf75a59a622da26abfa6c451f4702c0d56b4c3f08abfa1dbed410e8775

Contents?: true

Size: 1.26 KB

Versions: 20

Compression:

Stored size: 1.26 KB

Contents

require 'test_helper'

class RelationsControllerTest < Zena::Controller::TestCase

  def setup
    super
    login(:lion)
  end

  def test_should_get_index
    get :index
    assert_response :success
    assert assigns(:relations)
  end

  def test_should_not_find_index_if_not_admin
    login(:tiger)
    get :index
    assert_response :missing
  end

  def test_should_get_new
    get :new
    assert_response :success
  end

  def test_should_create_relation
    assert_difference('Relation.count', 1) do
      post :create, :relation => {:source_kpath => 'NR', :target_kpath => 'NP'}
    end
    assert_redirected_to relation_path(assigns(:relation))
  end

  def test_should_show_relation
    get :show, :id => relations_id(:node_has_tags)
    assert_response :success
  end

  def test_should_get_edit
    get :edit, :id => relations_id(:node_has_tags)
    assert_response :success
  end

  def test_should_update_relation
    put :update, :id => relations_id(:node_has_tags), :relation => {:source_role => 'taga' }
    assert_redirected_to relation_path(assigns(:relation))
  end

  def test_should_destroy_relation
    assert_difference('Relation.count', -1) do
      delete :destroy, :id => relations_id(:node_has_tags)
    end
    assert_redirected_to relations_path
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
zena-1.2.8 test/functional/relations_controller_test.rb
zena-1.2.7 test/functional/relations_controller_test.rb
zena-1.2.6 test/functional/relations_controller_test.rb
zena-1.2.5 test/functional/relations_controller_test.rb
zena-1.2.4 test/functional/relations_controller_test.rb
zena-1.2.3 test/functional/relations_controller_test.rb
zena-1.2.2 test/functional/relations_controller_test.rb
zena-1.2.1 test/functional/relations_controller_test.rb
zena-1.2.0 test/functional/relations_controller_test.rb
zena-1.1.3 test/functional/relations_controller_test.rb
zena-1.1.2 test/functional/relations_controller_test.rb
zena-1.1.1 test/functional/relations_controller_test.rb
zena-1.1.0 test/functional/relations_controller_test.rb
zena-1.0.0 test/functional/relations_controller_test.rb
zena-1.0.0.rc3 test/functional/relations_controller_test.rb
zena-1.0.0.rc2 test/functional/relations_controller_test.rb
zena-1.0.0.rc1 test/functional/relations_controller_test.rb
zena-1.0.0.beta3 test/functional/relations_controller_test.rb
zena-1.0.0.beta2 test/functional/relations_controller_test.rb
zena-1.0.0.beta1 test/functional/relations_controller_test.rb