Sha256: 1155f4fc27bfb8fe762dff0dd4170f2a2bfc1311d2419aba30d44e9793fdd88d

Contents?: true

Size: 975 Bytes

Versions: 12

Compression:

Stored size: 975 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'
require 'spree/testing_support/factories/user_factory'

RSpec.describe 'user factory' do
  let(:factory_class) { Spree.user_class }

  describe 'user' do
    let(:factory) { :user }

    it_behaves_like 'a working factory'
  end

  describe 'admin user' do
    it "builds successfully" do
      expect(build(:user, :admin)).to be_a(factory_class)
    end

    it "creates successfully" do
      expect(build(:user, :admin)).to be_a(factory_class)
    end

    it "is creates a valid record" do
      expect(build(:user, :admin)).to be_valid
    end
  end

  describe 'user with addresses' do
    it "builds successfully" do
      expect(build(:user, :with_addresses)).to be_a(factory_class)
    end

    it "creates successfully" do
      expect(build(:user, :with_addresses)).to be_a(factory_class)
    end

    it "is creates a valid record" do
      expect(build(:user, :with_addresses)).to be_valid
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
solidus_core_devise_token_auth-2.8.0.alpha.14 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.13 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.12 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.11 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.10 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.9 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.8 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.7 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.6 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.5 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.4 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.3 spec/lib/spree/core/testing_support/factories/user_factory_spec.rb