Repository URL to install this package:
|
Version:
1.44.1 ▾
|
require 'spec_helper'
describe JPlatform::Ticket::Resolution do
describe "validation" do
it "is not valid without a name" do
subject.name = nil
expect(subject).to have(1).errors_on(:name)
end
it "is not valid with a very long name" do
subject.name = "Z"*100
expect(subject).to have(1).errors_on(:name)
end
it "is not valid without a code" do
subject.code = nil
expect(subject).to have(1).errors_on(:code)
end
it "is not valid if code is too long" do
subject.code = "X"*30
expect(subject).to have(1).errors_on(:code)
end
end
describe "to_s string" do
it "contains the code and the name" do
subject.code = '002'
subject.name = 'Does not compute'
expect(subject.to_s).to include (subject.name and subject.code)
end
end
end