Sha256: 5cd9e96348faf67985974d834706e3c3656d8a4a24212bdd1b4abbea3e2abfbf

Contents?: true

Size: 789 Bytes

Versions: 5

Compression:

Stored size: 789 Bytes

Contents

require 'test_helper'

class EnvironmentTest < ActiveSupport::TestCase
  test "should have name" do
    env = Environment.new
    assert !env.valid?
  end

  test "name should be unique" do
    env = Environment.create :name => "foo"
    env2 = Environment.new :name => env.name
    assert !env2.valid?
  end

  test "name should have no spaces" do
    env = Environment.new :name => "f o o"
    assert !env.valid?
  end

  test "name should be alphanumeric" do
    env = Environment.new :name => "test&fail"
    assert !env.valid?
  end

  test "to_label should print name" do
    env = Environment.new :name => "foo"
    assert_equal env.to_label, env.name
  end

  test "to_s should print name" do
    env = Environment.new :name => "foo"
    assert_equal env.to_s, env.name
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/test/unit/environment_test.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/test/unit/environment_test.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/test/unit/environment_test.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/test/unit/environment_test.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/test/unit/environment_test.rb