Sha256: 361f44b49c26f29bcc6f086ebba0489061bb99f43a4234074babd2e48d0c2d01

Contents?: true

Size: 546 Bytes

Versions: 1

Compression:

Stored size: 546 Bytes

Contents

require 'spec_helper'

describe NinjaModel::Validation do
  class ValidationModel < NinjaModel::Base
    attribute :testing, :integer
    validates :testing, :numericality => true
  end

  before {
    @obj = ValidationModel.new
  }
  subject { @obj }
  it { should respond_to(:save) }
  it { should respond_to(:valid?) }

  describe 'save' do
    it 'should run the validation callbacks' do
      subject.expects(:run_callbacks).with(:validation).yields
      subject.expects(:run_callbacks).with(:validate)
      subject.save
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ninja-model-0.9.4 spec/lib/ninja_model/validation_spec.rb