Sha256: 03204b6b1c400baf068ef63d6abcddb5ddd6bf92bfc5877b2c5c82c51883f294

Contents?: true

Size: 911 Bytes

Versions: 1

Compression:

Stored size: 911 Bytes

Contents

require 'rspec'
require 'tms_bridge'
require File.expand_path(File.dirname(__FILE__) + '/mocks')

describe TmsBridge::ModelSupport do
  describe "published_attributes" do
    it "should not include 'id'" do
      expect(MockModel.published_attribute_names).to_not include('id')
    end

    it "should not include 'created_at'" do
      expect(MockModel.published_attribute_names).to_not include('created_at')
    end

    it "should not include 'updated_at" do
      expect(MockModel.published_attribute_names).to_not include('updated_at')
    end

    it "should include items declared in column_names" do
      expect(MockModel.published_attribute_names).to include('some_key')
    end
    
    it "should include alias_attributes" do
      expect(MockModel).to receive(:attribute_aliases){{"alias_key"=>"some_key"}}
      expect(MockModel.published_attribute_names).to include('alias_key')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tms_bridge-0.2.0 spec/tms_bridge/model_support_spec.rb