Sha256: 0339428e64dc45f6a5b5b86c5b157d5834668d2677e5291c618628402c3c5063

Contents?: true

Size: 615 Bytes

Versions: 1

Compression:

Stored size: 615 Bytes

Contents

require 'spec_helper'

describe Model do
  context 'class method' do
    it 'should mark name as required' do
      Model.mark_required?(:name).should be_true
    end
    it 'should not mark color as required' do
      Model.mark_required?(:color).should_not be_true
    end
  end
  context 'instance method' do
    before do
      @model = Model.create(:name => 'Bob', :color => 'green')
    end
    it 'should mark name as required' do
      @model.mark_required?(:name).should be_true
    end
    it 'should not mark color as required' do
      @model.mark_required?(:color).should_not be_true
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-mark_requirements-0.0.1 spec/rails-mark_requirements/mark_requirements_spec.rb