aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/custom_field_spec.rb
blob: b93d981876eed3b3343d2097973de0e774d14d3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'rails_helper'

RSpec.describe CustomField, type: :model do

  context "validates" do
    it { should validate_uniqueness_of(:name).scoped_to(:resource_type) }
  end

  context "field access" do
    let( :custom_field ){ build_stubbed :custom_field }

    it "option's values can be accessed by a key" do
      expect( custom_field.options['capacity'] ).to eq("0")
    end

  end
end