Sha256: d4ccf1c00591811027820ab2fe94c9e2ead7155a77dce77320ecd90549aaccb0

Contents?: true

Size: 823 Bytes

Versions: 6

Compression:

Stored size: 823 Bytes

Contents

require 'spec_helper'

module OpenStax
  module Accounts

    RSpec.describe CreateGroup, type: :routine do

      before(:all) do
        @previous_enable_stubbing = OpenStax::Accounts.configuration.enable_stubbing
        OpenStax::Accounts.configuration.enable_stubbing = true
      end

      let!(:owner) { FactoryBot.create :openstax_accounts_account }

      it 'can create groups' do
        group = CreateGroup[owner: owner, name: 'Test', is_public: true]
        expect(group).to be_persisted

        expect(group.name).to eq 'Test'
        expect(group.is_public).to eq true
        expect(group.owners.first).to eq owner
        expect(group.members).to be_empty
      end

      after(:all) do
        OpenStax::Accounts.configuration.enable_stubbing = @previous_enable_stubbing
      end

    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
openstax_accounts-8.0.0 spec/routines/openstax/accounts/create_group_spec.rb
openstax_accounts-7.13.1 spec/routines/openstax/accounts/create_group_spec.rb
openstax_accounts-7.13.0 spec/routines/openstax/accounts/create_group_spec.rb
openstax_accounts-7.12.0 spec/routines/openstax/accounts/create_group_spec.rb
openstax_accounts-7.11.0 spec/routines/openstax/accounts/create_group_spec.rb
openstax_accounts-7.10.0 spec/routines/openstax/accounts/create_group_spec.rb