Skip to content

Instantly share code, notes, and snippets.

View jgraichen's full-sized avatar

Jan Graichen jgraichen

View GitHub Profile
@jgraichen
jgraichen / keybase.md
Created December 16, 2019 09:46
keybase.md

Keybase proof

I hereby claim:

  • I am jgraichen on github.
  • I am jgraichen (https://keybase.io/jgraichen) on keybase.
  • I have a public key whose fingerprint is DAA4 E338 0D05 E6D0 D807 C428 C5C4 76B4 F274 91C9

To claim this, I am signing this object:

@jgraichen
jgraichen / test.rb
Created December 28, 2013 14:05
Run with RSpec mocks on Ruby 2.1 results in segfault. Run with `rspec test.rb`.
module A
def valid?(context)
true
end
end
module B
def valid?(*args)
super
end
let!(:operation) { Acfs::Stub.resource :update, MyResource, with: { id: 1, key: "value" }, return: { id: 1, key: "value" } }
it "should call update action" do
# call you complex method here
# eg. call controller method with form params
post :update, id: 1, my_resource: { key: "value" }, format: "json"
expect(operation).to be_called
end