Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
j_platform / spec / models / resolution_spec.rb
Size: Mime:
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