Sha256: c7dbb627a280ddbf2450401b21503ce1625752b55a250ea9a15b4570b25a176b
Contents?: true
Size: 1.3 KB
Versions: 1
Compression:
Stored size: 1.3 KB
Contents
# -*- encoding : utf-8 -*- require 'spec_helper' describe Mongoid::Userstamp::GemConfig do subject { Mongoid::Userstamp::GemConfig.new } describe '#initialize' do context 'without block' do it { should be_a Mongoid::Userstamp::GemConfig } it { subject.created_name.should eq :created_by } it { subject.updated_name.should eq :updated_by } it { subject.user_reader.should eq :current_user } end context 'with block' do subject do Mongoid::Userstamp::GemConfig.new do |u| u.created_name = :c_by u.updated_name = :u_by u.user_reader = :foo end end it { should be_a Mongoid::Userstamp::GemConfig } it { subject.created_name.should eq :c_by } it { subject.updated_name.should eq :u_by } it { subject.user_reader.should eq :foo } end end describe 'deprecated methods' do subject do Mongoid::Userstamp::GemConfig.new do |u| u.user_model = :bar u.created_column = :bing u.updated_column = :baz end end it { ->{ subject }.should_not raise_error } it { should be_a Mongoid::Userstamp::GemConfig } it { subject.created_name.should eq :bing } it { subject.updated_name.should eq :baz } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mongoid_userstamp-0.4.0 | spec/unit/gem_config_spec.rb |