Project

General

Profile

Download (820 Bytes) Statistics
| Branch: | Tag: | Revision:
require 'test_helper'

class OrganizationTest < ActiveSupport::TestCase
test 'it should not save with an empty name' do
organization = Organization.new
assert !organization.save
end

test 'it should not save with a blank name' do
organization = Organization.new
organization.name = " "
assert !organization.save
end

test 'it should not save another organization with the same name' do
organization = Organization.new
organization.name = "organization1"
assert organization.save

second_organization = Organization.new
second_organization.name = "organization1"
assert !second_organization.save
end

test 'it should show the name for to_s' do
organization = Organization.new :name => "organization1"
assert organization.to_s == "Organization1"
end
end
(36-36/58)