Sha256: 9ede6396b5cdc32176b8126c93db465cc553ccc61d3bae03d6e01b35df04832e

Contents?: true

Size: 629 Bytes

Versions: 7

Compression:

Stored size: 629 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'spec_helper'

describe Mongoid::Userstamp::UserConfig do

  subject { Mongoid::Userstamp::UserConfig.new }
  before  { Mongoid::Userstamp.stub('config').and_return(OpenStruct.new(user_reader: :foo)) }

  describe '#initialize' do

    context 'with opts hash' do
      subject { Mongoid::Userstamp::UserConfig.new({reader: :bar}) }

      it { should be_a Mongoid::Userstamp::UserConfig }
      it { subject.reader.should eq :bar }
    end

    context 'without opts hash' do
      it { should be_a Mongoid::Userstamp::UserConfig }
      it { subject.reader.should eq :foo }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mongoid-userstamps-3.1.3 spec/unit/user_config_spec.rb
mongoid-userstamps-3.1.2 spec/unit/user_config_spec.rb
mongoid-userstamps-3.1.1 spec/unit/user_config_spec.rb
mongoid-userstamps-3.1.0 spec/unit/user_config_spec.rb
mongoid-userstamps-3.0.0.alpha1 spec/unit/user_config_spec.rb
mongoid-userstamps-2.0.0 spec/unit/user_config_spec.rb
mongoid-userstamps-1.0.0 spec/unit/user_config_spec.rb