Skip to content

Instantly share code, notes, and snippets.

@Sparkmasterflex
Last active June 5, 2018 19:51
Show Gist options
  • Save Sparkmasterflex/9e37fa0ae48cefd41f7f055b7e26203b to your computer and use it in GitHub Desktop.
Save Sparkmasterflex/9e37fa0ae48cefd41f7f055b7e26203b to your computer and use it in GitHub Desktop.
Rspec Allow/Receive do block
specify "my super awesome test here" do
nested_value = "my awesome string"
allow(model).to receive(:method) do |arg|
expect(arg).to include(:nested_key)
expect(arg[:nested_key]).to eq nested_value
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment