Skip to content

Instantly share code, notes, and snippets.

@somethvictory
Last active July 17, 2018 15:00
Show Gist options
  • Save somethvictory/3f65771c7e6d713edc511f595f418e55 to your computer and use it in GitHub Desktop.
Save somethvictory/3f65771c7e6d713edc511f595f418e55 to your computer and use it in GitHub Desktop.
require 'rails_helper'
RSpec.describe Robot, 'Instance Methods', type: :model do
context 'when rusty' do
it 'should be recycled' do
robot = FactoryBot.create(:robot, :rusty)
expect(robot.should_be_recycled?).to eq true
end
end
context 'when loose screws' do
it 'should be recycled' do
robot = FactoryBot.create(:robot, :loose_screws)
expect(robot.should_be_recycled?).to eq true
end
end
context 'when paint scratched' do
it 'should not be recycled' do
robot = FactoryBot.create(:robot, :paint_scratched)
expect(robot.should_be_recycled?).to eq false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment