Skip to content

Instantly share code, notes, and snippets.

@alecslupu
Created September 18, 2015 11:15
Show Gist options
  • Save alecslupu/8396deb90c1e583c6fde to your computer and use it in GitHub Desktop.
Save alecslupu/8396deb90c1e583c6fde to your computer and use it in GitHub Desktop.
it 'should update rates when subject is accepted' do
previous_rate = subject.sale_rate
new_rate = rand(1..10).to_f
subject.update_attribute(:sale_rate, new_rate)
expect {
subject.accept
}.to change {
subject.sale_rate.round(2).to_f
}.by((new_rate - previous_rate).round(2).to_f)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment