Last active
July 17, 2018 15:00
-
-
Save somethvictory/3f65771c7e6d713edc511f595f418e55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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