Skip to content

Instantly share code, notes, and snippets.

@dnovais
Last active August 13, 2018 15:06
Show Gist options
  • Save dnovais/53f94ccc30cea7b9bbff5294534dd56a to your computer and use it in GitHub Desktop.
Save dnovais/53f94ccc30cea7b9bbff5294534dd56a to your computer and use it in GitHub Desktop.
Model - Rspec with private methods

Para testar meteodos privados no model

Para testar os metodos privados, podemos usar o send para chamar o metodo.

context 'Metodos privados' do
  it 'Metodo para gerar URI' do
    expect(subject.uri).to eq(subject.send(:gerar_uri))
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment