Ruby on Rails - unit test in ruby on rails - ruby on rails tutorial - rails guides - rails tutorial - ruby rails
unit test
Unit tests test parts of the application in isolation. usually a unit under test is a class or module.
let(:gift) { create :gift }
describe '#find' do
subject { described_class.find(user, Time.zone.now.to_date) }
it { is_expected.to eq gift }
end
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - ruby on rails tutorial - rails guides - ruby rails - rubyonrails - learn ruby on rails - team
source
This kind if test is as direct and specific as possible.