Sha256: 0c45920ab9c829ba48a7b2c440f18129c291d1e74efae5252960ff52f340c729
Contents?: true
Size: 1.05 KB
Versions: 20
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true # This file demonstrates how simple creation, reading updating and deletion (CRUD) # can be done through LeapSalesforce classes # Depending on validation rules and mandatory fields this may or may not work RSpec.describe 'Contact CRUD' do let(:uniq_value) { "UNIQ #{Faker::Name.first_name} #{Faker::Name.middle_name}" } let(:updated_value) { "New #{Faker::Name.first_name} #{Faker::Name.neutral_first_name}" } it 'Create using factory bot' do @contact = FactoryBot.create(:contact) end it 'Read contact by name' do FactoryBot.create(:contact, first_name: uniq_value) @contact = Contact.find(first_name: uniq_value) retrieved_first_name = @contact.first_name expect(retrieved_first_name).to eq uniq_value end it 'Updates contacts name' do @contact = FactoryBot.create(:contact, first_name: uniq_value) @contact.first_name = updated_value expect(@contact.find.first_name).to eq updated_value end after { @contact.delete } # Delete data after each action. Comment out if you want data to remain end
Version data entries
20 entries across 20 versions & 1 rubygems