Sha256: 5483bfda7341294e0b5a9a298198f09c7f2618e4dafe102e773fd45328c471c8

Contents?: true

Size: 610 Bytes

Versions: 19

Compression:

Stored size: 610 Bytes

Contents

require 'spec_helper'

module OpenStax::Accounts
  describe Group do
    context 'validation' do
      it 'requires a unique openstax_uid' do
        group = FactoryGirl.build(:openstax_accounts_group, openstax_uid: nil)
        expect(group).not_to be_valid
        expect(group.errors[:openstax_uid]).to eq(['can\'t be blank'])

        group.openstax_uid = 1
        group.save!

        group_2 = FactoryGirl.build(:openstax_accounts_group, openstax_uid: 1)
        expect(group_2).not_to be_valid
        expect(group_2.errors[:openstax_uid]).to eq(['has already been taken'])
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
openstax_accounts-6.1.5 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-6.1.4 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-6.1.3 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-6.1.2 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-6.1.1 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-6.1.0 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-6.0.0 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-5.2.0 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-5.1.2 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-5.1.1 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-5.1.0 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-5.0.1 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-5.0.0 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-4.1.1 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-4.1.0 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-4.0.0 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-3.1.1 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-3.1.0 spec/models/openstax/accounts/group_spec.rb
openstax_accounts-3.0.0 spec/models/openstax/accounts/group_spec.rb