Skip to content

Instantly share code, notes, and snippets.

@mariusz-blaszczak
Created January 24, 2018 08:29
Show Gist options
  • Save mariusz-blaszczak/d626adc72d7b5c236e5cc7b78e3dd941 to your computer and use it in GitHub Desktop.
Save mariusz-blaszczak/d626adc72d7b5c236e5cc7b78e3dd941 to your computer and use it in GitHub Desktop.
Ruby code sample for rubymine support
# not expected
it 'updates postal code of the customer' do
customer = build(:hiltes_kunde)
customer.anschrift.Plz = '1500'
customer.save
params = ActionController::Parameters.new(
postal_code: '1501', hiltes_mandant: 1, hiltes_firmengruppe: 1, hiltes_nr: customer.Nr
)
service = described_class.new
expect { service.call(params) }
.to change { customer.reload.Plz }
.from('1500')
.to('1501')
end
#expected formatting
it 'updates postal code of the customer' do
customer = build(:hiltes_kunde)
customer.anschrift.Plz = '1500'
customer.save
params = ActionController::Parameters.new(
postal_code: '1501', hiltes_mandant: 1, hiltes_firmengruppe: 1, hiltes_nr: customer.Nr
)
service = described_class.new
expect { service.call(params) }
.to change { customer.reload.Plz }
.from('1500')
.to('1501')
endng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment