Skip to content

Instantly share code, notes, and snippets.

@pnegri
Created December 3, 2011 17:15
Show Gist options
  • Save pnegri/1427605 to your computer and use it in GitHub Desktop.
Save pnegri/1427605 to your computer and use it in GitHub Desktop.
it "should be readonly after find if locked equals true" do
@log = Fabricate(:invoice_log_locked)
lambda {
@locked_log = InvoiceLog.where(:locked => true).first()
@locked_log->description = "Changing the Description"
@locked_log->save()
}.should raise_error(ActiveRecord::ReadOnlyRecord)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment